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

Open
opened 2026-11-26 20:19:21 +01:00 by 4ld0 · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/840
Author: @trigger337
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/bink-play-stage-cleanup


📝 Commits (1)

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

📊 Changes

2 files changed (+64 additions, -1 deletions)

View changed files

📝 tests/test_bink_play.py (+54 -0)
📝 tools/bink_play.py (+10 -1)

📄 Description

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


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ubiquitarianism/leonida/pull/840 **Author:** [@trigger337](https://github.com/trigger337) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/bink-play-stage-cleanup` --- ### 📝 Commits (1) - [`d6cee3e`](https://github.com/ubiquitarianism/leonida/commit/d6cee3e108ee561b53232bd8864003c6398283a1) bink_play: close mkstemp fd on open error and restore write mode before unlink on replace failure (BINK-PLAY-STAGE-CLEANUP) ### 📊 Changes **2 files changed** (+64 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_bink_play.py` (+54 -0) 📝 `tools/bink_play.py` (+10 -1) </details> ### 📄 Description 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 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
starred/leonida#878
No description provided.