-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
bpo-30246: fix several error messages which only mention bytes in struct #1421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@zhangyangyu, thanks for your PR! By analyzing the history of the files in this pull request, we identified @Yhg1s, @serhiy-storchaka and @mdickinson to be potential reviewers. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small point, other LGTM
Modules/_struct.c
Outdated
"iterative unpacking requires a bytes length " | ||
"multiple of %zd", | ||
"iterative unpacking requires a bytes-like object of " | ||
"length multiple of %zd", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe bytes-like object of its length is multiple of
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't haste with merging this patch. I'll try to find the past discussion about the similar issue.
@@ -1734,8 +1735,8 @@ Struct_iter_unpack(PyStructObject *self, PyObject *buffer) | |||
} | |||
if (iter->buf.len % self->s_size != 0) { | |||
PyErr_Format(StructError, | |||
"iterative unpacking requires a bytes length " | |||
"multiple of %zd", | |||
"iterative unpacking requires a buffer of " |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"length" is lost.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I delibrately discard it. Now the error messages in struct all get a "requires a buffer of %d bytes" format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
“. . . a buffer of a multiple of . . .” would read better to me. Or simpler: “requires a multiple of . . . bytes”.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
What's the status of this PR @serhiy-storchaka ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this wording is alright.
Is it okay for me to merge this now @vadmium @serhiy-storchaka ? |
The changes look okay to me. |
Thanks @zhangyangyu for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6. |
Sorry, @zhangyangyu, I could not cleanly backport this to |
GH-3561 is a backport of this pull request to the 3.6 branch. |
No description provided.