Atom http-core handle bytes strings.#1
Conversation
If instance of 'bytes' variable is detected data are decoded using 'utf-8' by default and treated as the string.
|
I'm a bit unsure of the motivation behind this. Most internal data processing in a Python 3 application should be text except in very specialized cases. In addition, It's generally not a good idea to design APIs that take both binary data and text and try to do the right thing with both inputs, as mentioned in https://docs.python.org/3/howto/pyporting.html#text-versus-binary-data. Is there a specific exception that you fixed with this change? I use this fork of gdata to upload videos to YouTube (successfully) and do not want the video data decoded as text or anything along those lines. |
|
I've just fixed exception during existing user's password change: raise UnknownSize('Each part of the body must have a known size.') from line 124 was raised. This fix translate binary to string because method expects strings and for some reason does it get it under Python 3. I saw similar fixes in other parts of the code so I thought it will be good idea. |
If instance of 'bytes' variable is detected data are decoded using
'utf-8' by default and treated as the string.