Skip to content

Conversation

gpshead
Copy link
Member

@gpshead gpshead commented Mar 5, 2020

list(sys.modules.items()) was apparently not immune to "dictionary
changed size during iteration" errors.

https://bugs.python.org/issue13487

…afety.

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.
@gpshead gpshead added type-bug An unexpected behavior, bug, or error needs backport to 3.7 labels Mar 5, 2020
@gpshead gpshead self-assigned this Mar 5, 2020
@gpshead gpshead changed the title bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread s… bpo-13487: Use sys.modules.copy() in inspect for thread safety Mar 5, 2020
@gpshead gpshead requested a review from Yhg1s March 5, 2020 00:24
@gpshead gpshead merged commit 85cf1d5 into python:master Mar 5, 2020
@miss-islington
Copy link
Contributor

Thanks @gpshead for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-18787 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 5, 2020
…afety. (pythonGH-18786)

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d5)

Co-authored-by: Gregory P. Smith <gps@google.com>
@gpshead gpshead deleted the inspect_getmodule_sys_modules_dict_copy branch March 5, 2020 00:45
@bedevere-bot
Copy link

GH-18788 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 5, 2020
…afety. (pythonGH-18786)

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d5)

Co-authored-by: Gregory P. Smith <gps@google.com>
miss-islington added a commit that referenced this pull request Mar 5, 2020
…afety. (GH-18786)

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d5)

Co-authored-by: Gregory P. Smith <gps@google.com>
miss-islington added a commit that referenced this pull request Mar 5, 2020
…afety. (GH-18786)

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d5)

Co-authored-by: Gregory P. Smith <gps@google.com>
ned-deily pushed a commit that referenced this pull request Mar 10, 2020
…afety. (GH-18786)

`list(sys.modules.items())` was apparently not immune to "dictionary
changed size during iteration" errors.

Tested internally using an integration test that has run into this a couple of times in the past two years.  With this patch applied, the test is no longer flaky.
(cherry picked from commit 85cf1d5)

Co-authored-by: Gregory P. Smith <gps@google.com>
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