[PR #253] [MERGED] common.run(): exit with a message when a command times out #254

Closed
opened 2026-10-15 20:54:50 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/rehan-remade/universal-modder/pull/253
Author: @OpenGithubs
Created: 10/12/2026
Status: ✅ Merged
Merged: 10/12/2026
Merged by: @rehan-remade

Base: main ← Head: fix-timeout-expired-not-caught


📝 Commits (3)

  • 05a2e71 fix: catch TimeoutExpired in common.run() to prevent unhandled crash
  • a27b040 tests: common.run() exits with a message when a command times out
  • 0af25a0 Merge remote-tracking branch 'origin/main' into land/pr-253

📊 Changes

2 files changed (+10 additions, -0 deletions)

View changed files

📝 tests/test_um.py (+8 -0)
📝 um/common.py (+2 -0)

📄 Description

Summary

Bug fix: Handle subprocess.TimeoutExpired in common.run().

Problem: The run() helper in um/common.py catches FileNotFoundError and subprocess.CalledProcessError but not subprocess.TimeoutExpired. When any command that uses the timeout= argument times out, the exception propagates up as an unhandled crash instead of producing a clean die() exit with a descriptive message.

Solution: Add a dedicated except subprocess.TimeoutExpired: clause that calls die() with the command name and timeout duration, consistent with the existing error-handling style in the same function.

Changes

  • um/common.py

Commits

  • 05a2e71 fix: catch TimeoutExpired in common.run() to prevent unhandled crash

🔄 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/rehan-remade/universal-modder/pull/253 **Author:** [@OpenGithubs](https://github.com/OpenGithubs) **Created:** 10/12/2026 **Status:** ✅ Merged **Merged:** 10/12/2026 **Merged by:** [@rehan-remade](https://github.com/rehan-remade) **Base:** `main` ← **Head:** `fix-timeout-expired-not-caught` --- ### 📝 Commits (3) - [`05a2e71`](https://github.com/rehan-remade/universal-modder/commit/05a2e71714dd633444a44b5e60c1fad20100637f) fix: catch TimeoutExpired in common.run() to prevent unhandled crash - [`a27b040`](https://github.com/rehan-remade/universal-modder/commit/a27b0408f16b4a688660362040f9f9472b910870) tests: common.run() exits with a message when a command times out - [`0af25a0`](https://github.com/rehan-remade/universal-modder/commit/0af25a013f21095833e50df8cba11e98136f3ed0) Merge remote-tracking branch 'origin/main' into land/pr-253 ### 📊 Changes **2 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `tests/test_um.py` (+8 -0) 📝 `um/common.py` (+2 -0) </details> ### 📄 Description ## Summary **Bug fix**: Handle `subprocess.TimeoutExpired` in `common.run()`. **Problem**: The `run()` helper in `um/common.py` catches `FileNotFoundError` and `subprocess.CalledProcessError` but not `subprocess.TimeoutExpired`. When any command that uses the `timeout=` argument times out, the exception propagates up as an unhandled crash instead of producing a clean `die()` exit with a descriptive message. **Solution**: Add a dedicated `except subprocess.TimeoutExpired:` clause that calls `die()` with the command name and timeout duration, consistent with the existing error-handling style in the same function. ## Changes - `um/common.py` ## Commits - `05a2e71` fix: catch TimeoutExpired in common.run() to prevent unhandled crash --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-15 20:54:50 +00:00
Sign in to join this conversation.
No labels
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
rehan-remade/universal-modder#254
No description provided.