bpo-13487: Use sys.modules.copy() in inspect for thread safety by gpshead · Pull Request #18786 · python/cpython (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation3 Commits1 Checks0 Files changed

Conversation

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})

gpshead

@gpshead

…afety.

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

@gpshead gpshead changed the titlebpo-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

Yhg1s

@miss-islington

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

@bedevere-bot

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 5, 2020

@gpshead @miss-islington

…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

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request

Mar 5, 2020

@gpshead @miss-islington

…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

@miss-islington @gpshead

…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

@miss-islington @gpshead

…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

Labels

type-bug

An unexpected behavior, bug, or error