Skip to content

bpo-29116: Fix error messages for concatenating bytes and bytearray w… #709

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

Merged

Conversation

serhiy-storchaka
Copy link
Member

…ith unsupported type.

@mention-bot
Copy link

@serhiy-storchaka, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tiran, @loewis and @benjaminp to be potential reviewers.

@@ -1438,7 +1438,7 @@ bytes_concat(PyObject *a, PyObject *b)
if (PyObject_GetBuffer(a, &va, PyBUF_SIMPLE) != 0 ||
PyObject_GetBuffer(b, &vb, PyBUF_SIMPLE) != 0) {
PyErr_Format(PyExc_TypeError, "can't concat %.100s to %.100s",
Py_TYPE(a)->tp_name, Py_TYPE(b)->tp_name);
Py_TYPE(b)->tp_name, Py_TYPE(a)->tp_name);
Copy link
Member

Choose a reason for hiding this comment

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

I think it would be clearer to use "concatenate" instead of "concat" here and above. (Also other errors of similar kind use the full word.)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll do this in separate PR, because this is larger change that shouldn't be backported. The same error message is generated in yet one place (with correct order of arguments). Maybe will make the message being more similar to other concatenate messages.

Copy link
Member

Choose a reason for hiding this comment

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

@serhiy-storchaka serhiy-storchaka merged commit 6b5a9ec into python:master Mar 19, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Mar 19, 2017
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request Mar 19, 2017
@serhiy-storchaka serhiy-storchaka deleted the bytes-concat-error-msg branch March 19, 2017 18:19
serhiy-storchaka added a commit that referenced this pull request Mar 19, 2017
…ith unsupported type. (#709) (#723)

(cherry picked from commit 6b5a9ec)
serhiy-storchaka added a commit that referenced this pull request Mar 19, 2017
…ith unsupported type. (#709) (#724)

(cherry picked from commit 6b5a9ec)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants