[issue23816] struct.unpack returns null pascal strings - [first] bug report

Mark Dickinson report at bugs.python.org
Thu May 4 03:40:43 EDT 2017


Mark Dickinson added the comment:

Specifically, I believe what's happening here is that "8s4spp" is interpreted as "8s4s1p1p", so it decodes a single byte (which can only encode an empty string) for each of the "1p" cases.

I wonder whether the struct module should raise an exception if the length byte read from the encoded data exceeds the count given in the format.

----------

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


More information about the Python-bugs-list mailing list