This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vajrasky
Recipients vajrasky
Date 2013-12-15.09:28:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387099730.06.0.788825958744.issue19985@psf.upfronthosting.co.za>
In-reply-to
Content
Python 3.4 (3.3 is also afflicted:

>>> import struct
>>> struct.Struct(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Struct() argument 1 must be a bytes object, not int
>>> struct.Struct('b')
<Struct object at 0x7fec04763180>

Python 2.7:

>>> import struct
>>> struct.Struct(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Struct() argument 1 must be string, not int
>>> struct.Struct(u'b')
<Struct object at 0x17993e8>

Here is the patch to better error message for Python 3.4 and 3.3.
History
Date User Action Args
2013-12-15 09:28:50vajraskysetrecipients: + vajrasky
2013-12-15 09:28:50vajraskysetmessageid: <1387099730.06.0.788825958744.issue19985@psf.upfronthosting.co.za>
2013-12-15 09:28:49vajraskylinkissue19985 messages
2013-12-15 09:28:49vajraskycreate