From 40301e4d8763241932783228b0006f1279c516aa Mon Sep 17 00:00:00 2001 From: ARUNAGIRINATHAN-K Date: Sat, 5 Dec 2026 22:48:37 +0530 Subject: [PATCH 1/3] Fix #11603 follow-up: Correct make_numbered_dir multiprocess-safety docstring Legacy py.path.local.make_numbered_dir is not guaranteed multiprocess-safe per #11611, even with lock files. Update docstring to reflect that and point to _pytest.pathlib.make_numbered_dir_with_cleanup used by pytest core. --- src/_pytest/_py/path.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/_pytest/_py/path.py b/src/_pytest/_py/path.py index 998a7819972..a34082eb7cb 100644 --- a/src/_pytest/_py/path.py +++ b/src/_pytest/_py/path.py @@ -1279,7 +1279,9 @@ def make_numbered_dir( maximum one. The number is assumed to start directly after prefix. if keep is true directories with a number less than (maxnum-keep) will be removed. If .lock files are used (lock_timeout non-zero), - algorithm is multi-process safe. + they prevent cleanup of directories currently in use. However, the + allocation and cleanup operations are not safe when called concurrently + from multiple processes; see pytest-dev/pytest#11603. """ if rootdir is None: rootdir = cls.get_temproot() From 03b6eb3ac143b265b26a57b6fec56119586950b5 Mon Sep 17 00:00:00 2001 From: ARUNAGIRINATHAN-K Date: Sat, 5 Dec 2026 23:46:00 +0530 Subject: [PATCH 2/3] added Changelo --- changelog/13693.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/13693.bugfix.rst diff --git a/changelog/13693.bugfix.rst b/changelog/13693.bugfix.rst new file mode 100644 index 00000000000..ffc23f34204 --- /dev/null +++ b/changelog/13693.bugfix.rst @@ -0,0 +1 @@ +Live logging from background threads no longer suspends output capture globally, preventing concurrent writes to standard output and error from being lost. From f210373e70550d2cbdbddbe800fb563007805aaa Mon Sep 17 00:00:00 2001 From: ARUNAGIRINATHAN-K Date: Sat, 5 Dec 2026 23:48:44 +0530 Subject: [PATCH 3/3] Update --changelo bugfix --- changelog/13693.bugfix.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/13693.bugfix.rst b/changelog/13693.bugfix.rst index ffc23f34204..e972d534ab9 100644 --- a/changelog/13693.bugfix.rst +++ b/changelog/13693.bugfix.rst @@ -1 +1 @@ -Live logging from background threads no longer suspends output capture globally, preventing concurrent writes to standard output and error from being lost. +Fixed an issue where output written to standard output or error could be lost when live logging emitted messages from background threads while using :fixture:`capfd` or :fixture:`capsys`.