Skip to content

[3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) - #158489

Merged
Yhg1s merged 3 commits into
python:3.12from
encukou:backport-5c20517-3.12
Sep 30, 2026
Merged

Yhg1s merged 3 commits into
python:3.12from
encukou:backport-5c20517-3.12

Conversation

@encukou

@encukou encukou commented Sep 30, 2026 •

Copy link
Copy Markdown
Member

This also backports:

  • a test helper, as for the current 3.13 & 3.14 PRs
  • the fix from gh-134993: Add os.lstat() to os.supports_dir_fd #135188: add os.lstat to os.supports_dir_fd on systems with lstat. @Yhg1s, this needs your decision. lstat in supports_dir_fd is only used in fallback and in tests, so we could do without it (use dir_fd in a LBYL try block rather than checking supports_dir_fd), but it seems better to backport the fix and keep the code the same as the higher version.
StanFromIreland and others added 3 commits September 30, 2026 11:27
…raryDirectory` (pythonGH-157580)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
(cherry picked from commit 5c20517)
This partially backports commit 86b8617
(pythonGH-146195); making existing tests use the helper is omitted.
@Yhg1s
Yhg1s merged commit 458e713 into python:3.12 Sep 30, 2026
28 checks passed
Yhg1s added a commit that referenced this pull request Sep 30, 2026
Revert "[3.12] gh-157579: Fix race condition in the cleanup of tempfile.TemporaryDirectory (GH-157580) (#158489)"

This reverts commit 458e713.
@encukou
encukou deleted the backport-5c20517-3.12 branch October 2, 2026 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants