Skip to content

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

Merged
serhiy-storchaka merged 3 commits into
python:masterfrom
serhiy-storchaka:type-setattr-noninterned
May 20, 2017
Merged

bpo-25794: Fix type.__setattr__() for non-interned attribute names.#1652
serhiy-storchaka merged 3 commits into
python:masterfrom
serhiy-storchaka:type-setattr-noninterned

Conversation

@serhiy-storchaka

Copy link
Copy Markdown
Member

Based on patch by Eryk Sun.

@mention-bot

Copy link
Copy Markdown

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

Comment threadObjects/typeobject.c Outdated
return -1;
}
copied = 1;
assert(PyUnicode_CheckExact(name));

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.

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

Comment threadObjects/typeobject.c
int offset;

assert(PyUnicode_CheckExact(name));
assert(PyUnicode_CHECK_INTERNED(name));

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.

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:masterMay 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
Copy Markdown
MemberAuthor

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 freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type-bugAn unexpected behavior, bug, or error

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@serhiy-storchaka@mention-bot@berkerpeksag@Mariatta@the-knights-who-say-ni