Skip to content

fix: temp file not cleaned up after extract - #2

Merged
vados-cosmonic merged 2 commits into
mainfrom
fix-temp-file
Dec 30, 2025
Merged

vados-cosmonic merged 2 commits into
mainfrom
fix-temp-file

Conversation

@ricochet

Copy link
Copy Markdown
Contributor

No description provided.

On Windows, file handles must be closed before other processes can access or delete the file. Added file.close() immediately after creating the temp file so:
  1. urlretrieve can write to it
  2. tarfile.open can read it
  3. os.unlink can delete it

@vados-cosmonic vados-cosmonic left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

A little surprised we can't keep the with here but a try finally is also fine

@vados-cosmonic
vados-cosmonic merged commit 51dcaab into main Dec 30, 2025
17 checks passed
@ricochet
ricochet deleted the fix-temp-file branch January 5, 2026 16:08
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.

2 participants