Author vajrasky
Recipients ezio.melotti, mark.dickinson, meador.inge, miwa, pitrou, python-dev, serhiy.storchaka, vajrasky
Date 2013-12-14.04:13:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1386994430.22.0.113816783649.issue19099@psf.upfronthosting.co.za>
In-reply-to
Content
Okay, I think the error message can be improved because in Python 2.7 we differentiate very clearly the string from the unicode.

>>> import struct
>>> struct.Struct(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: Struct() argument 1 must be string, not int

But you can give unicode, right?

>>> struct.Struct(u'b')
<Struct object at 0x1f484b8>

This is consistent with other example:

>>> " cutecat ".strip(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: strip arg must be None, str or unicode

What do you say, Serhiy?

Here is the patch.
History
Date User Action Args
2013-12-14 04:13:50vajraskysetrecipients: + vajrasky, mark.dickinson, pitrou, ezio.melotti, miwa, meador.inge, python-dev, serhiy.storchaka
2013-12-14 04:13:50vajraskysetmessageid: <1386994430.22.0.113816783649.issue19099@psf.upfronthosting.co.za>
2013-12-14 04:13:50vajraskylinkissue19099 messages
2013-12-14 04:13:49vajraskycreate