Skip to content

bpo-31492: Fix assertion failures in case of a module with a bad __name__ attribute#3620

Merged
serhiy-storchaka merged 4 commits into
python:masterfrom
orenmn:bpo31492-fix-assert-fails
Sep 19, 2017
Merged

bpo-31492: Fix assertion failures in case of a module with a bad __name__ attribute#3620
serhiy-storchaka merged 4 commits into
python:masterfrom
orenmn:bpo31492-fix-assert-fails

Conversation

@orenmn

@orenmn orenmn commented Sep 16, 2017

Copy link
Copy Markdown
Contributor
  • in moduleobject.c: add a check whether the retrieved __name__ attribute is a string. while we are here, remove a redundant call to PyErr_Clear().
  • in ceval.c: add a check whether the retrieved __name__ attribute is not a string.
  • in test_import/__init__.py: add a test to verify that the assertion failures are no more.

https://bugs.python.org/issue31492

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @orenmn for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖

@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @orenmn and @serhiy-storchaka, I could not cleanly backport this to 3.6 due to a conflict.
Please backport using cherry_picker on command line.

serhiy-storchaka pushed a commit to serhiy-storchaka/cpython that referenced this pull request Sep 26, 2017
@bedevere-bot

Copy link
Copy Markdown

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

serhiy-storchaka added a commit that referenced this pull request Sep 27, 2017
…d __name__ attribute. (GH-3620). (#3773)

(cherry picked from commit 6db7033)
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.

6 participants