Skip to content

[3.8] bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786)#18787

Merged
miss-islington merged 1 commit intopython:3.8from
miss-islington:backport-85cf1d5-3.8
Mar 5, 2020
Merged

[3.8] bpo-13487: Use sys.modules.copy() in inspect.getmodule() for thread safety. (GH-18786)#18787
miss-islington merged 1 commit intopython:3.8from
miss-islington:backport-85cf1d5-3.8

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Mar 5, 2020

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 [email protected]

https://bugs.python.org/issue13487

Automerge-Triggered-By: @gpshead

…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 <[email protected]>
@miss-islington
Copy link
Copy Markdown
Contributor Author

@gpshead: Status check is done, and it's a success ✅ .

@miss-islington miss-islington merged commit 6b452ff into python:3.8 Mar 5, 2020
@miss-islington miss-islington deleted the backport-85cf1d5-3.8 branch March 5, 2020 01:04
@miss-islington
Copy link
Copy Markdown
Contributor Author

@gpshead: Status check is done, and it's a success ✅ .

1 similar comment
@miss-islington
Copy link
Copy Markdown
Contributor Author

@gpshead: Status check is done, and it's a success ✅ .

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.

4 participants