Skip to content
Snippets Groups Projects
  • Vermaat's avatar
    0e1c2d92
    Use unicode string arguments in webservice interface definitions · 0e1c2d92
    Vermaat authored
    This fixes Spyne to not crash on POST requests to the HTTP/RPC+JSON
    webservice.
    
    Note that all return values still use byte strings. Changing those will
    touch a larger part of the codebase, and will be done in another commit.
    
    As per [1]:
    
    > Unlike the Python str, the Spyne String is not for arbitrary byte
    > streams. You should not use it unless you are absolutely, positively
    > sure that you need to deal with text data with an unknown encoding. In
    > all other cases, you should just use the Unicode type. They actually
    > look the same from outside, this distinction is made just to properly
    > deal with the quirks surrounding Python-2’s unicode type.
    >
    > Remember that you have the ByteArray and File types at your disposal
    > when you need to deal with arbitrary byte streams.
    >
    > The String type will be just an alias for Unicode once Spyne gets
    > ported to Python 3. It might even be deprecated and removed in the
    > future, so make sure you are using either Unicode or ByteArray in your
    > interface definitions.
    
    [1] http://spyne.io/docs/2.10/manual/03_types.html#strings
    0e1c2d92
    History
    Use unicode string arguments in webservice interface definitions
    Vermaat authored
    This fixes Spyne to not crash on POST requests to the HTTP/RPC+JSON
    webservice.
    
    Note that all return values still use byte strings. Changing those will
    touch a larger part of the codebase, and will be done in another commit.
    
    As per [1]:
    
    > Unlike the Python str, the Spyne String is not for arbitrary byte
    > streams. You should not use it unless you are absolutely, positively
    > sure that you need to deal with text data with an unknown encoding. In
    > all other cases, you should just use the Unicode type. They actually
    > look the same from outside, this distinction is made just to properly
    > deal with the quirks surrounding Python-2’s unicode type.
    >
    > Remember that you have the ByteArray and File types at your disposal
    > when you need to deal with arbitrary byte streams.
    >
    > The String type will be just an alias for Unicode once Spyne gets
    > ported to Python 3. It might even be deprecated and removed in the
    > future, so make sure you are using either Unicode or ByteArray in your
    > interface definitions.
    
    [1] http://spyne.io/docs/2.10/manual/03_types.html#strings
This project manages its dependencies using pip. Learn more