cpython/Doc/c-api
Petr Viktorin 4ebbfcf30e
gh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh-130402)
If `Py_IsFinalizing()` is true, non-daemon threads (other than the current one)
are done, and daemon threads are prevented from running, so they
cannot finalize themselves and become done. Joining them (without timeout)
would block forever.

Raise PythonFinalizationError instead of hanging.

Raise even when a timeout is given, for consistency with trying to join your own thread.

See gh-123940 for a use case: calling `join()` from `__del__`. This is
ill-advised, but an exception should at least make it easier to diagnose.
2025-04-28 15:48:48 +02:00
..
abstract.rst
allocation.rst gh-129675: Update documentation for tp_basicsize & tp_itemsize (#129850) 2025-03-11 11:21:18 +01:00
apiabiversion.rst gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630) 2025-01-09 11:10:28 +01:00
arg.rst gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988) 2025-04-26 17:14:18 +03:00
bool.rst gh-110481, doc: Add "immortal" term to the glossary (#112180) 2023-11-17 15:09:19 +01:00
buffer.rst gh-132246: Add PEP 688 to C Buffer Protocol docs (#132249) 2025-04-08 10:43:27 -07:00
bytearray.rst Python 3.14.0a5 2025-02-11 19:16:29 +02:00
bytes.rst gh-121645: Fix typo in PyBytes_Join() doc (#123783) 2024-09-06 16:08:17 +02:00
call.rst Add a version added note for PY_VECTORCALL_ARGUMENTS_OFFSET (#110963) 2023-10-23 19:00:52 +03:00
capsule.rst
cell.rst gh-121533: Improve PyCell_[Get,Set] docs: mention the exceptions (#121534) 2024-07-09 18:47:35 +03:00
code.rst gh-70870: Clarify dual usage of 'free variable' (#122545) 2024-10-08 07:52:12 +00:00
codec.rst
complex.rst gh-128813: hide mixed-mode functions for complex arithmetic from C-API (#131703) 2025-04-22 14:18:18 +02:00
concrete.rst
contextvars.rst gh-124872: Replace enter/exit events with "switched" (#125532) 2024-10-16 13:53:21 +02:00
conversion.rst gh-120026: soft deprecate Py_HUGE_VAL macro (#120027) 2024-11-01 22:04:31 +00:00
coro.rst
datetime.rst gh-123517: Remove unnecessary `:meth:` parentheses (#123518) 2024-09-01 05:59:42 +01:00
descriptor.rst
dict.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
exceptions.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
file.rst gh-115172: Fix explicit index extries for the C API (GH-115173) 2024-02-11 12:23:30 +02:00
float.rst gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
frame.rst gh-118915: C API: Document frame locals proxies. (#127720) 2024-12-11 17:28:44 +01:00
function.rst gh-130169: Fix broken list markup in Doc/c-api/function.rst (#130174) 2025-02-16 13:55:31 +03:00
gcsupport.rst Docs: Fix specifications of gcvisitobjects_t (#132433) 2025-04-12 17:36:02 +02:00
gen.rst
hash.rst gh-122854: Add Py_HashBuffer() function (#122855) 2024-08-30 15:42:27 +00:00
import.rst gh-128911: Add PyImport_ImportModuleAttr() function (#128912) 2025-01-30 11:17:29 +00:00
index.rst gh-111997: C-API for signalling monitoring events (#116413) 2024-05-04 08:23:50 +00:00
init.rst gh-87135: Raise PythonFinalizationError when joining a blocked daemon thread (gh-130402) 2025-04-28 15:48:48 +02:00
init_config.rst gh-107954: Add audit event to PyConfig_Set() (#132958) 2025-04-25 18:30:39 +02:00
intro.rst Fix a grammar error in the Py_ALWAYS_INLINE doc (#129304) 2025-04-24 17:20:48 +03:00
iter.rst gh-105201: Add PyIter_NextItem() (#122331) 2024-08-08 00:47:15 +02:00
iterator.rst
list.rst gh-121403: Add notes for PyList_GetXXX APIs about the need for init (gh-121626) 2024-07-16 10:16:41 +09:00
long.rst gh-102471: Change PyLongWriter_Discard(NULL) to do nothing (#129339) 2025-01-27 10:51:16 +00:00
mapping.rst gh-108511: Add C API functions which do not silently ignore errors (GH-109025) 2023-09-17 14:23:31 +03:00
marshal.rst gh-125063: marshal: Add version 5, improve documentation (GH-126829) 2024-11-15 13:48:57 +01:00
memory.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
memoryview.rst gh-101100: Fix sphinx warnings in Doc/c-api/memoryview.rst (GH-114669) 2024-01-29 11:56:11 +02:00
method.rst
module.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
monitoring.rst Python 3.14.0a7 2025-04-08 14:20:51 +03:00
none.rst gh-110481, doc: Add "immortal" term to the glossary (#112180) 2023-11-17 15:09:19 +01:00
number.rst gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
object.rst Python 3.14.0a5 2025-02-11 19:16:29 +02:00
objimpl.rst
perfmaps.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
refcounting.rst Use pep role instead of url (#121611) 2024-09-17 16:02:14 +03:00
reflection.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
sequence.rst gh-127896: Add missing documentation of PySequence_In (GH-127979) 2024-12-16 14:56:04 +01:00
set.rst gh-101100: Fix Sphinx reference warnings (GH-112416) 2023-11-25 15:40:19 -08:00
slice.rst gh-130214: Document PyEllipsis_Type (GH-130215) 2025-02-17 13:56:33 +01:00
stable.rst gh-127253: Note that Stable ABI is about ABI stability (GH-127254) 2024-12-03 13:30:27 +01:00
structures.rst gh-130711: Document PyBaseObject_Type (GH-130712) 2025-03-03 15:08:05 +01:00
sys.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
time.rst gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990) 2025-03-20 13:06:59 +01:00
tuple.rst gh-124182: Explain naming rules for struct sequence types (#124335) 2024-10-07 19:52:34 +02:00
type.rst gh-131544: Update docs for PyType_AddWatcher (gh-132015) 2025-04-02 15:04:07 +00:00
typehints.rst
typeobj.rst Fix a typo in c-api/typeobj.rst (#132317) 2025-04-13 07:18:58 +00:00
unicode.rst gh-46236: Add Py_UNICODE_REPLACEMENT_CHARACTER doc (#132706) 2025-04-22 14:16:51 +02:00
utilities.rst gh-110850: Add PyTime_t C API (GH-115215) 2024-02-12 18:13:10 +01:00
veryhigh.rst gh-118915: C API: Document compiler flag macros (GH-129028) 2025-01-20 17:45:08 +01:00
weakref.rst gh-128008: Add PyWeakref_IsDead() (GH-128009) 2024-12-19 16:17:15 +01:00