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-31492: Fix assertion failures in case of a module with a bad __name__ attribute #3620

Merged
merged 4 commits into from
Sep 19, 2017

Conversation

orenmn
Copy link
Contributor

@orenmn orenmn commented Sep 16, 2017

  • 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
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
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

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