Vajrasky Kok added the comment:

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.

----------
Added file: 
http://bugs.python.org/file33126/fix_error_message_struct_Struct.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

Reply via email to