Skip to content

fix: use tempfile.gettempdir() for cross-platform tmp cleanup#115

Open
marceljungle wants to merge 1 commit into
mainfrom
hotfix/fix-cross-platform-tmp-cleanup
Open

fix: use tempfile.gettempdir() for cross-platform tmp cleanup#115
marceljungle wants to merge 1 commit into
mainfrom
hotfix/fix-cross-platform-tmp-cleanup

Conversation

@marceljungle

@marceljungle marceljungle commented May 8, 2026

Copy link
Copy Markdown
Owner

Problem

_cleanup_stale_tmp_files() was hardcoded to glob /tmp/tmp*.tmp, which only works on Linux. On macOS, Python's tempfile module writes to $TMPDIR (/var/folders/.../T/), and on Windows to %TEMP%. This caused orphaned .tmp audio files to accumulate indefinitely on non-Linux systems, eventually filling the disk.

Fix

Replace the hardcoded /tmp path with tempfile.gettempdir() + os.path.join(), which resolves to the correct platform-specific temp directory on Linux, macOS, and Windows.

The cleanup function was hardcoded to /tmp/tmp*.tmp which only works
on Linux. On macOS, tempfile writes to $TMPDIR (/var/folders/...),
and on Windows to %TEMP%, causing orphaned files to never be cleaned
up and eventually filling the disk.
@marceljungle marceljungle added bug Something isn't working hotfix labels May 8, 2026
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

⚠️ Release preview unavailable. Add a hotfix, minor, or major label to view the upcoming release summary.

@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Release Preview for v0.7.3

🚀 Features

  • No matching pull requests

🐛 Fixes

🔧 Chores

  • No matching pull requests

📝 Other Changes

1 similar comment
@github-actions

github-actions Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Release Preview for v0.7.3

🚀 Features

  • No matching pull requests

🐛 Fixes

🔧 Chores

  • No matching pull requests

📝 Other Changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working hotfix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant