]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-93353: Fix importlib.resources._tempfile() finalizer (#93377)
authorVictor Stinner <vstinner@python.org>
Mon, 13 Jun 2022 17:24:00 +0000 (19:24 +0200)
committerGitHub <noreply@github.com>
Mon, 13 Jun 2022 17:24:00 +0000 (19:24 +0200)
commit443ca731d6b1267fe2f92985e0490460c95e44a8
tree69e0a0ff3e4d33bcd88dd37ed5947c19b2a630f5
parent3ceb4b8d3ad48101e67da8fb8f581d3377863bfa
gh-93353: Fix importlib.resources._tempfile() finalizer (#93377)

Fix the importlib.resources.as_file() context manager to remove the
temporary file if destroyed late during Python finalization: keep a
local reference to the os.remove() function. Patch by Victor Stinner.
Lib/importlib/resources/_common.py
Misc/NEWS.d/next/Library/2022-05-31-14-58-40.gh-issue-93353.9Hvm6o.rst [new file with mode: 0644]