Vajrasky Kok added the comment: Here's the preliminary patch. I am assuming that we should accept unicode argument not reject it straight away.
Python3 does that. >>> import struct >>> struct.pack('b', 3) b'\x03' >>> struct.pack(b'b', 3) b'\x03' >>> struct.pack(b'\xff', 3) Traceback (most recent call last): File "<stdin>", line 1, in <module> struct.error: bad char in struct format ---------- keywords: +patch nosy: +vajrasky Added file: http://bugs.python.org/file31922/handle_ascii_range_unicode_in_struct_pack.patch _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue19099> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com