New submission from Musashi Tamura: C:\>python Python 2.7.5 (default, May 15 2013, 22:44:16) [MSC v.1500 64 bit AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import struct >>> struct.pack(u'B',1) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: Struct() argument 1 must be string, not unicode >>> struct.pack(u'B',1) Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: Struct() argument 1 must be string, not unicode >>> struct.pack('B',1) # this is ok '\x01' >>> struct.pack(u'B',1) '\x01'
---------- components: Unicode messages: 198464 nosy: ezio.melotti, miwa priority: normal severity: normal status: open title: struct.pack fails first time with unicode fmt type: behavior versions: Python 2.7 _______________________________________ 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