Skip to content

bpo-30246: fix several error messages which only mention bytes in struct#1421

Merged
zhangyangyu merged 3 commits into
python:masterfrom
zhangyangyu:struct-errmsg
Sep 14, 2017
Merged

bpo-30246: fix several error messages which only mention bytes in struct#1421
zhangyangyu merged 3 commits into
python:masterfrom
zhangyangyu:struct-errmsg

Conversation

@zhangyangyu

Copy link
Copy Markdown
Member

No description provided.

@mention-bot

Copy link
Copy Markdown

@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.

@louisom louisom left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small point, other LGTM

Comment thread 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",

@louisom louisom May 3, 2017

Copy link
Copy Markdown
Contributor

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?

@serhiy-storchaka serhiy-storchaka left a comment

Copy link
Copy Markdown
Member

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.

Comment thread Modules/_struct.c
PyErr_Format(StructError,
"iterative unpacking requires a bytes length "
"multiple of %zd",
"iterative unpacking requires a buffer of "

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"length" is lost.

Copy link
Copy Markdown
Member Author

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.

Copy link
Copy Markdown
Member

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”.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@zhangyangyu

Copy link
Copy Markdown
Member Author

What's the status of this PR @serhiy-storchaka ?

@AraHaan AraHaan left a comment

Copy link
Copy Markdown
Contributor

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.

@zhangyangyu

Copy link
Copy Markdown
Member Author

Is it okay for me to merge this now @vadmium @serhiy-storchaka ?

@vadmium

vadmium commented Sep 13, 2017

Copy link
Copy Markdown
Member

The changes look okay to me.

@zhangyangyu zhangyangyu merged commit c3e97d9 into python:master Sep 14, 2017
@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @zhangyangyu for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@zhangyangyu zhangyangyu deleted the struct-errmsg branch September 14, 2017 02:33
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @zhangyangyu, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.

@bedevere-bot

Copy link
Copy Markdown

GH-3561 is a backport of this pull request to the 3.6 branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants