Skip to content

Comments

gh-66305: Fix a hang on Windows in the tempfile module#144672

Merged
serhiy-storchaka merged 7 commits intopython:mainfrom
serhiy-storchaka:tempfile-hangs-on-bad-tempdir
Feb 24, 2026
Merged

gh-66305: Fix a hang on Windows in the tempfile module#144672
serhiy-storchaka merged 7 commits intopython:mainfrom
serhiy-storchaka:tempfile-hangs-on-bad-tempdir

Conversation

@serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Feb 10, 2026

It occurred when trying to create a temporary file or subdirectory in a non-writable directory.

…le module

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
@serhiy-storchaka
Copy link
Member Author

Reducing the number of attempts should help, but I have not tested yet.

@serhiy-storchaka serhiy-storchaka force-pushed the tempfile-hangs-on-bad-tempdir branch from 77ade1f to ac17d9e Compare February 10, 2026 19:26
@serhiy-storchaka serhiy-storchaka changed the title gh-66305: Fix a hang for a few seconds on Windows in the tempfile module gh-66305: Fix a hang on Windows in the tempfile module Feb 10, 2026
@serhiy-storchaka
Copy link
Member Author

Tested on Windows. There was a test for readonly tempdir, but it was always skipped on Windows. It was not for a few seconds, but for about 10 days (for estimations). Now the test correctly works on Windows.

@serhiy-storchaka serhiy-storchaka marked this pull request as ready for review February 10, 2026 19:43
@serhiy-storchaka serhiy-storchaka merged commit ca66d3c into python:main Feb 24, 2026
47 checks passed
@miss-islington-app
Copy link

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@serhiy-storchaka serhiy-storchaka deleted the tempfile-hangs-on-bad-tempdir branch February 24, 2026 11:05
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 24, 2026
…H-144672)

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c40cd9ac1fb94dd7cd79ccb8fecf019527)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Feb 24, 2026
…H-144672)

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

bedevere-app bot commented Feb 24, 2026

GH-145168 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.14 bugs and security fixes label Feb 24, 2026
@bedevere-app
Copy link

bedevere-app bot commented Feb 24, 2026

GH-145169 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label Feb 24, 2026
serhiy-storchaka added a commit that referenced this pull request Feb 24, 2026
) (GH-145168)

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
serhiy-storchaka added a commit that referenced this pull request Feb 24, 2026
) (GH-145169)

It occurred when trying to create a temporary file or subdirectory in
a non-writable directory.
(cherry picked from commit ca66d3c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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.

1 participant