[issue17339] bytes() TypeError message is misleadingly narrow

Martin Panter report at bugs.python.org
Sat Apr 9 10:03:02 EDT 2016


Martin Panter added the comment:

I think this patch is okay.

I would have suggested “Cannot construct bytes from [. . .]” to avoid the problem with “convert”, but this message is produced in places other than the constructor, e.g.

>>> int.from_bytes("str", "little")
TypeError: cannot convert unicode object to bytes

----------
nosy: +martin.panter

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


More information about the Python-bugs-list mailing list