[issue30246] fix several error messages in struct

Serhiy Storchaka report at bugs.python.org
Wed May 3 04:01:44 EDT 2017


Serhiy Storchaka added the comment:

"unpack requires a bytes-like object of length %zd" is not correct too. array.array('i', [1, 2, 3]) has length 3, but Struct('3b').unpack doesn't accept it. The more correct error message is "unpack requires an object containing %zd bytes" (or "a buffer"). The similar issue was discussed some time ago, but I don't remember what module was discussed and who participated in that discussion.

----------
nosy: +berker.peksag, mark.dickinson, martin.panter, meador.inge, r.david.murray, serhiy.storchaka

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


More information about the Python-bugs-list mailing list