Skip to content
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

bpo-25794: Fix type.__setattr__() for non-interned attribute names. #1652

Merged

Conversation

serhiy-storchaka
Copy link
Member

Based on patch by Eryk Sun.

@mention-bot
Copy link

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

return -1;
}
copied = 1;
assert(PyUnicode_CheckExact(name));
Copy link
Member

Choose a reason for hiding this comment

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

Do we need another call to PyUnicode_CheckExact if PyUnicode_CheckExact(name) in line 3142 returns true?

@@ -7090,6 +7115,9 @@ update_slot(PyTypeObject *type, PyObject *name)
slotdef **pp;
int offset;

assert(PyUnicode_CheckExact(name));
assert(PyUnicode_CHECK_INTERNED(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 guess we can now remove the following comment in line 7131:

/* XXX assume name is interned! */

@serhiy-storchaka serhiy-storchaka merged commit d896985 into python:master May 20, 2017
@serhiy-storchaka serhiy-storchaka deleted the type-setattr-noninterned branch May 20, 2017 05:48
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request May 20, 2017
…names. (pythonGH-1652)

Based on patch by Eryk Sun..
(cherry picked from commit d896985)
serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request May 20, 2017
…names. (pythonGH-1652)

Based on patch by Eryk Sun..
(cherry picked from commit d896985)
@serhiy-storchaka
Copy link
Member Author

Thank you for your review @berkerpeksag.

serhiy-storchaka added a commit to serhiy-storchaka/cpython that referenced this pull request May 20, 2017
…names. (pythonGH-1652)

Based on patch by Eryk Sun..
(cherry picked from commit d896985)
serhiy-storchaka added a commit that referenced this pull request May 20, 2017
… attribute names. (GH-1652) (#1675)

Based on patch by Eryk Sun.
(cherry picked from commit d896985)
serhiy-storchaka added a commit that referenced this pull request May 20, 2017
…names. (GH-1652) (#1673)

Based on patch by Eryk Sun.
(cherry picked from commit d896985)
serhiy-storchaka added a commit that referenced this pull request May 20, 2017
…names. (GH-1652) (#1674)

Based on patch by Eryk Sun.
(cherry picked from commit d896985)
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.

5 participants