-
-
Notifications
You must be signed in to change notification settings - Fork 29.5k
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-29620: iterate over a copy of sys.modules #4800
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please add a test? It is enough to create a types.ModuleType
subclass with the __warningregistry__
property (or the __getattr__()
method) which mutates sys.modules
and add its instance to sys.modules
.
Add also a news entry (see https://devguide.python.org/committing/#what-s-new-and-news-entries).
Done. Hope it's ok. |
Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst
Outdated
Show resolved
Hide resolved
Misc/NEWS.d/next/Library/2018-08-21-16-20-33.bpo-29620.xxx666.rst
Outdated
Show resolved
Hide resolved
Updated. Thanks. |
@serhiy-storchaka Do you find any other issues? |
@kernc I'm running into this issue - is it at all possible to prioritize this issue? |
@serhiy-storchaka Would it be possible to review this PR or is there something I can do? |
@serhiy-storchaka If there's any way either myself or @kernc could help, please let me know! If there's someone else / something else we need to do please let us know. |
@serhiy-storchaka Any chance you could take a look at this? |
@serhiy-storchaka is there anything else required for review? |
@akuchling Looks like this is good? |
@akuchling, should this be merged? Thanks! |
Thanks @kernc for the PR, and @akuchling for merging it 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
GH-20816 is a backport of this pull request to the 3.8 branch. |
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
GH-20817 is a backport of this pull request to the 3.7 branch. |
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc.
Thanks @kernc for the PR, and @akuchling for merging it 🌮🎉.. I'm working now to backport this PR to: 3.9. |
GH-29605 is a backport of this pull request to the 3.9 branch. |
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
unittest.TestCase.assertWarns no longer raises a RuntimeException when accessing a module's ``__warningregistry__`` causes importation of a new module, or when a new module is imported in another thread. Patch by Kernc. (cherry picked from commit 46398fb) Co-authored-by: kernc <kerncece@gmail.com>
Fixes https://bugs.python.org/issue29620 by wrapping
sys.modules.values()
into a tuple before iteration.https://bugs.python.org/issue29620