[issue17828] More informative error handling when encoding and decoding

Nick Coghlan report at bugs.python.org
Fri May 10 04:42:35 CEST 2013


Nick Coghlan added the comment:

Ezio pointed out on IRC that the extra type checks in str.encode, bytes.decode and bytearray.decode should reference the appopriate codecs module function in addition to the codec in use.

So if str.encode produces something other than bytes, it should reference codecs.encode, while the binary decoding methods should mention codecs.decode if they produce something other than str.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17828>
_______________________________________


More information about the Python-bugs-list mailing list