[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Xiang Zhang
Changes by Xiang Zhang : -- versions: +Python 3.6, Python 3.7 -Python 3.3, Python 3.4 ___ Python tracker ___

[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Xiang Zhang
Changes by Xiang Zhang : -- dependencies: +fix several error messages in struct -Document whether it's safe to use bytes for struct format string resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker

[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Martin Panter
Martin Panter added the comment: For Python 2.7, this change doesn’t seem important enough for a bug fix. -- ___ Python tracker ___

[issue19985] Not so correct error message when initializing Struct with ill argument

2016-04-14 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +Document whether it's safe to use bytes for struct format string -Not so correct error message when initializing Struct with ill argument ___ Python tracker

[issue19985] Not so correct error message when initializing Struct with ill argument

2016-04-14 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +Not so correct error message when initializing Struct with ill argument ___ Python tracker

[issue19985] Not so correct error message when initializing Struct with ill argument

2015-02-16 Thread Martin Panter
Martin Panter added the comment: Closely related: * Issue 16349: document byte string format argument support * Issue 21071: should the Struct.format property be bytes or text? -- nosy: +vadmium ___ Python tracker rep...@bugs.python.org

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: And here is the patch to better error message in Python 2.7. -- Added file: http://bugs.python.org/file33144/better_error_message_struct_python_27.patch ___ Python tracker rep...@bugs.python.org

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
New submission from Vajrasky Kok: 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

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think that error message in 2.7 is correct. String means both str and unicode. As for 3.x, agree, it should be corrected. But I prefer str or bytes or string or bytes object. -- nosy: +serhiy.storchaka versions: -Python 2.7

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- nosy: +mark.dickinson, meador.inge ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19985 ___ ___

[issue19985] Not so correct error message when initializing Struct with ill argument

2013-12-15 Thread Vajrasky Kok
Vajrasky Kok added the comment: Here is the patch to address Serhiy's request. Hmmm, if string means both string and unicode in Python 2.7, should we fix these behaviours? import _csv _csv.register_dialect(2) Traceback (most recent call last): File stdin, line 1, in module TypeError: