[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 ___ ___ Python-bugs-list mai

[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

[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 "", line 1, in TypeError: dialect

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

2013-12-15 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +mark.dickinson, meador.inge ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[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 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 "", line 1, in TypeError: Struct() argument 1 must be a bytes object, not int >>> struct.Struct('b') Python 2.7: >>> import struct >>> struct.

[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 _