gh-118362: Fix thread safety around lookups from the type cache in the face of concurrent mutators by DinoV · Pull Request #118454 · python/cpython
bot
mentioned this pull request
Makes setting an attribute on a class and signaling type modified atomic Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
DinoV
marked this pull request as ready for review
Fix some formatting Add news blurb Use PyDictObject * more Rename _PyDict_GetItemRef_LockHeld to _PyDict_GetItemRef_Unicode_LockHeld Reduce iterations in test Expose _PyObject_SetAttributeErrorContext for attaching context
colesbury
changed the title
[gh-118362] Fix thread safety around lookups from the type cache in the face of concurrent mutators
gh-118362: Fix thread safety around lookups from the type cache in the face of concurrent mutators
DinoV
mentioned this pull request
SonicField pushed a commit to SonicField/cpython that referenced this pull request
May 8, 2024… in the face of concurrent mutators (python#118454) Add _PyType_LookupRef and use incref before setting attribute on type Makes setting an attribute on a class and signaling type modified atomic Avoid adding re-entrancy exposing the type cache in an inconsistent state by decrefing after type is updated
DinoV
deleted the
nogil_type_crash
branch
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 7, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 8, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 8, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 8, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 8, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Dec 9, 2025Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
filmor added a commit to pythonnet/pythonnet that referenced this pull request
Feb 24, 2026Python 3.14 introduced a new assertion that prevents us from using PyObject_GenericSetAttr directly in our meta type. To work around this, we manipulate the type dict directly. This workaround is a simplified variant of Cython's workaround from cython/cython#6325. The relevant Python change is in python/cpython#118454
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