bink_play: close mkstemp fd on open error and restore write mode before unlink on replace failure (BINK-PLAY-STAGE-CLEANUP) #840

Merged
leonida/mandy
trigger337 merged 1 commit from fix/bink-play-stage-cleanup into main 2026-11-28 11:09:10 +00:00

Pull request successfully merged and closed

trigger337 commented 2026-11-24 14:26:09 +00:00

In load_names cache write, if opening the mkstemp file descriptor fails, explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod to 0o600 before unlinking to prevent Windows PermissionError on cleanup.

agent: yes
AI-assisted: yes

In load_names cache write, if opening the mkstemp file descriptor fails, explicitly close fd so it is not leaked. On os.replace failure, reset os.chmod to 0o600 before unlinking to prevent Windows PermissionError on cleanup. agent: yes AI-assisted: yes
abnalstlll-byte approved these changes 2026-11-24 14:40:27 +00:00
abnalstlll-byte left a comment

Audited and verified. Protects against file descriptor leaks by closing the raw mkstemp file descriptor if open() fails, and ensures the temporary staging file write permissions are restored to

Audited and verified. Protects against file descriptor leaks by closing the raw mkstemp file descriptor if open() fails, and ensures the temporary staging file write permissions are restored to
MoonEyes commented 2026-11-28 11:09:06 +00:00

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18).
Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13.
AI-assisted (Claude Code, Claude Opus 5.5)

Red/green: the PR's tests fail on main and pass with this PR (Linux, Python 3.13.18). Targeted batch of 23 PRs (their tests, the tests importing the changed modules, the docs tests) on main 3ca0707: no new failure, Linux / Python 3.13. AI-assisted (Claude Code, Claude Opus 5.5)
Sign in to join this conversation.
No description provided.