Python 3.14 by filmor · Pull Request #2611 · pythonnet/pythonnet
filmor
marked this pull request as ready for review
--- updated-dependencies: - dependency-name: NUnit3TestAdapter dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major - dependency-name: NUnit3TestAdapter dependency-version: 6.0.0 dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Not at all sure why this helps, but when assigning `None` instead, the object is gone at the time of garbage collection.
- The first two run into issues because our meta type's `tp_getattro` is not overridden by its subclasses - The last runs into a `PyErrOccurred` when trying to access its `__len__`, related to our sequence decoding logic
In Python 3.14, the objects __dict__ seems to already be half deconstructed, leading to crashes during garbage collection. Since gc in Python is single-threaded (I think :)), it should be fine to have a single static for this. If that is not true, we can always use a thread-local instead.
Python 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