[issue10783] struct.pack() and Unicode strings

Amaury Forgeot d'Arc report at bugs.python.org
Tue Dec 28 13:09:59 CET 2010


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

Since the Release Manager agrees with the change, I withdraw my objection.

I have three remarks to the patch: 

- Some examples in the documentation should be fixed:
http://docs.python.org/dev/py3k/library/struct.html#examples
>>> pack('ci', '*', 0x12131415)
will now raise an exception.

- the message "argument for 's' must be a bytes" looks a bit weird. "a bytes object" seems better.

- the 'p' format (Pascal String) should be changed as well. This is the last call to _PyUnicode_AsDefaultEncodedString() in this file...

----------

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


More information about the Python-bugs-list mailing list