Nick Coghlan added the comment:

For the warnings, it's actually bytes.decode() (et al) that are expected to 
return str, and str.encode() that's expected to return bytes. The codecs 
themselves remain free to do what they want (hence the recommendation to use 
codecs.encode() and codecs.decode() to invoke arbitrary codecs without the type 
constraints of the builtins). Aside from that, those 2 warnings and the 
unicode.decode() one look good.

However, the "bytes.encode()" warning is the one we determined couldn't be 
treated as a warning as "text".encode("ascii") is valid in both Python 2 & 3, 
it just does a str->str conversion in 2.x, and a str -> bytes conversion in 3.x.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19543>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to