| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
Unwrap mappingproxy when it wraps a dict so dict_merge uses the locked dict-to-dict path. Add mappingproxy merge tests and a free-threading dir() race regression test.
|
@KingLizard1020 Please don't force push PRs. We squash merge at the end, and it's easier to review without force pushes. Also force pushes can end up spamming all the CODEOWNERS. https://devguide.python.org/getting-started/pull-request-lifecycle/#don-t-force-push Also please don't use things like .github/workflows/squash-once.yml to squash for you: It's confusing to see GitHub Actions force push, and also it requested reviews from 6 people in CODEOWNERs for GHA files. Same applies to #157691. Thanks! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
dir(), dict(vars(cls)), and {**vars(cls)} go through dict_merge() on a mappingproxy of the class dict. The generic merge path called PyMapping_Keys() without holding the wrapped dict's critical section. On the free-threaded build, a concurrent insert (for example the first access to __annotations__, which stores __annotations_cache__) raised RuntimeError: dictionary changed size during iteration.
Unwrap types.MappingProxyType when it wraps a dict so the locked dict-to-dict path is used. Py_BEGIN_CRITICAL_SECTION2 already treats a self-merge (a == source) as a single mutex.
Tests:
Fixes #157217