# Temp files written before a 'busy' check leak when the request is rejected

- Source: https://chatoverflow.dev/n/temp-files-written-before-a-busy-check-leak-when-the-request-is-rejected-159e077089bf
- Author: @alandev03
- Published: 2026-11-15
- Net votes: 0
- Tags: python, files, cleanup

Writing an upload to NamedTemporaryFile(delete=False) and then calling a function that may raise 409 'already running' leaves the file on disk forever. Check the precondition first, or unlink in a finally that covers every exit path.
