Skip to content

Conversation

@TkTech
Copy link
Owner

@TkTech TkTech commented Mar 21, 2025

This issue was introduced in 3.13 (5a1ecc8) and causes spurious errors when threads shutdown. This issue occurs on all platforms, and can be triggered by utilities like coverage.py's pytracer module or the PyCharm debugger (pydevd), which may keep references to internal threading objects around.

Issue was reproduced on Linux/OSX/Windows:

Exception ignored in: <function _DeleteDummyThreadOnDel.__del__ at 0x10a0811c0>
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.13/lib/python3.13/threading.py", line 1383, in __del__
TypeError: 'NoneType' object does not support the context manager protocol
 Exception ignored in: <function _DeleteDummyThreadOnDel.__del__ at 0x7fedc963ff60>
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.13.2/x64/lib/python3.13/threading.py", line 1383, in __del__
TypeError: 'NoneType' object does not support the context manager protocol
 Exception ignored in: <function _DeleteDummyThreadOnDel.__del__ at 0x000001A6B07BA840>
Traceback (most recent call last):
  File "C:\hostedtoolcache\windows\Python\3.13.2\x64\Lib\threading.py", line 1383, in __del__
TypeError: 'NoneType' object does not support the context manager protocol

serhiy-storchaka and others added 30 commits July 3, 2025 23:33
…ng to the HTML5 standard (pythonGH-135930)

* Whitespaces no longer accepted between `</` and the tag name.
  E.g. `</ script>` does not end the script section.

* Vertical tabulation (`\v`) and non-ASCII whitespaces no longer recognized
  as whitespaces. The only whitespaces are `\t\n\r\f `.

* Null character (U+0000) no longer ends the tag name.

* Attributes and slashes after the tag name in end tags are now ignored,
  instead of terminating after the first `>` in quoted attribute value.
  E.g. `</script/foo=">"/>`.

* Multiple slashes and whitespaces between the last attribute and closing `>`
  are now ignored in both start and end tags. E.g. `<a foo=bar/ //>`.

* Multiple `=` between attribute name and value are no longer collapsed.
  E.g. `<a foo==bar>` produces attribute "foo" with value "=bar".

* Whitespaces between the `=` separator and attribute name or value are no
  longer ignored. E.g. `<a foo =bar>` produces two attributes "foo" and
  "=bar", both with value None; `<a foo= bar>` produces two attributes:
  "foo" with value "" and "bar" with value None.

* Fix Sphinx errors.

* Apply suggestions from code review

Co-authored-by: Ezio Melotti <[email protected]>

* Address review comments.

* Move to Security.

---------

Co-authored-by: Ezio Melotti <[email protected]>
…#135794)

This fixes the data races in typeobject.c in subinterpreters under free-threading. The type flags and slots are only modified in the main interpreter as all static types are first initialised in main interpreter.
…TML5 standard (pythonGH-135664)

* "--!>" now ends the comment.
* "-- >" no longer ends the comment.
* Support abnormally ended empty comments "<-->" and "<--->".

---------

Co-author: Kerim Kabirov <[email protected]>
Co-authored-by: Ezio Melotti <[email protected]>
…educe home (python#135831)

This is still formally undefined behaviour, but we may as well
keep the *same* undefined behaviour as previous versions.

PEP 796 proposes a cleaner and more consistent replacement for 3.15+
…nGH-136258)

Use the %N format specifier instead of %s and `PyType_GetName`.
…de effect (python#136341)

Document that get_context in multiprocessing have side effect
* Remove the table
* Replace warnings with notes


Latest releases of Python 3.9-3.15 include expat 2.7.1 which is not vulnerable.

expat 2.6.0 was released in February 2024.
…cts (pythonGH-135980)

* Turn the __future__ table to list-table.
  This'll make it easier to add entries that need longer markup
* Semantic markup for __future__ feature descriptions.
* Document CO_* C macros.
canova and others added 30 commits July 22, 2025 16:47
…ythonGH-137031)

pythongh-136461 added perf support for macOS, with ifdefs around all changes
except increasing thread_id to 64 bits.
Make that change Apple-specific too.
…pythonGH-136419)

Files like NUL on windows are, from `importlib.resources` point of
view, an artifact caused by installing to a filesystem directory.
Mention these.
…lass, make the original class collectible (python#136893)" (python#137014)

This reverts commit 46cbdf9.
… sections (pythonGH-135942)

Co-authored-by: Blaise Pabon <[email protected]>
Co-authored-by: Stan Ulbrych <[email protected]>
Co-authored-by: Adam Turner <[email protected]>
The comment in the generated file is now more self-explanatory. The checks for unexpected file contents are also strengthened.
Adds tooling to build mpdec (and thus _decimal) as part of an Emscripten build.
python#137004)

Adds a mechanism to test browser-based initialisation of the Python interpreter,
via a Playwright headless browser instance.
Rename `lock.h` to `pylock.h` to avoid conflicts with headers of other projects.
…n#136994)

De-instrumenting code objects modifies the thread local bytecode for all threads as such, holding the critical section on the code object is not sufficient and leads to data races. Now, the de-instrumentation is now performed under a stop the world pause as such no thread races with executing the thread local bytecode while it is being de-instrumented.
_testclinic.c mocks out PY_VERSION_HEX to 3.8 before including
_testclinic_depr.c.h to avoid the errors the preprocessor would
otherwise throw due to the deprecation feature it is testing.

Also partially revert 74e2acd:
this restores Modules/_testclinic.c to match the same file in the 3.14
branch.
…cTest's lineno computation (pythonGH-136930)

Previously, DocTest's lineno of functions and methods decorated with
functools.cache(), functools.lru_cache() and functools.cached_property()
was not properly returned (None was returned) because the
computation relied on inspect.isfunction() which does not consider the
decorated result as a function.

We now use the more generic inspect.isroutine(), as elsewhere
in doctest's logic.

Also, added a special case for functools.cached_property().
…thonGH-137094)

Use a `PyEvent` instead of a lock to fix a race on the free-threaded build.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.