classification
Title: fix several error messages in struct
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: berker.peksag, mark.dickinson, martin.panter, meador.inge, r.david.murray, serhiy.storchaka, xiang.zhang
Priority: normal Keywords: patch

Created on 2017-05-03 07:37 by xiang.zhang, last changed 2017-09-14 03:23 by xiang.zhang. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 1421 merged xiang.zhang, 2017-05-03 07:38
PR 3561 merged xiang.zhang, 2017-09-14 03:01
Messages (5)
msg292854 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-05-03 07:37
There are several error messages only mention bytes. But they may also accept string or other bytes-like objects.
msg292859 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-05-03 08:01
"unpack requires a bytes-like object of length %zd" is not correct too. array.array('i', [1, 2, 3]) has length 3, but Struct('3b').unpack doesn't accept it. The more correct error message is "unpack requires an object containing %zd bytes" (or "a buffer"). The similar issue was discussed some time ago, but I don't remember what module was discussed and who participated in that discussion.
msg302116 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-09-13 21:04
FWIW a similar change to the Struct constructor message was also proposed in Issue 19985.
msg302137 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-09-14 02:33
New changeset c3e97d9d984130d1c2aceedc4dfcd603b3162688 by Xiang Zhang in branch 'master':
bpo-30246: fix several error messages which only mention bytes in struct (#1421)
https://github.com/python/cpython/commit/c3e97d9d984130d1c2aceedc4dfcd603b3162688
msg302139 - (view) Author: Xiang Zhang (xiang.zhang) * (Python committer) Date: 2017-09-14 03:22
New changeset fa82dda1012b406a7091587fc65384ce11528346 by Xiang Zhang in branch '3.6':
[3.6] bpo-30246: fix several error messages which only mention bytes in struct (#3561)
https://github.com/python/cpython/commit/fa82dda1012b406a7091587fc65384ce11528346
History
Date User Action Args
2017-09-14 03:25:33xiang.zhanglinkissue19985 dependencies
2017-09-14 03:23:45xiang.zhangsetstatus: open -> closed
stage: patch review -> resolved
resolution: fixed
versions: - Python 3.5
2017-09-14 03:22:26xiang.zhangsetmessages: + msg302139
2017-09-14 03:01:50xiang.zhangsetkeywords: + patch
pull_requests: + pull_request3552
2017-09-14 02:33:28xiang.zhangsetmessages: + msg302137
2017-09-13 21:04:38martin.pantersetmessages: + msg302116
2017-05-03 08:01:44serhiy.storchakasetnosy: + serhiy.storchaka, berker.peksag, r.david.murray, mark.dickinson, meador.inge, martin.panter
messages: + msg292859
2017-05-03 07:38:47xiang.zhangsetpull_requests: + pull_request1527
2017-05-03 07:37:18xiang.zhangcreate