[PR #1124] boot_trace: handle read errors during iteration (BOOT-TRACE-READ-ERROR) #1158

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

📋 Pull Request Information

Original PR: https://github.com/ubiquitarianism/leonida/pull/1124
Author: @Taffyyy-ops
Created: 11/24/2026
Status: 🔄 Open

Base: main ← Head: fix/boot-trace-read-error


📝 Commits (1)

  • 75fc533 boot_trace: handle read errors during iteration (BOOT-TRACE-READ-ERROR)

📊 Changes

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

View changed files

➕ tests/test_boot_trace_read_error.py (+51 -0)
📝 tools/boot_trace.py (+4 -1)

📄 Description

Item ID: BOOT-TRACE-READ-ERROR

Converts tools/boot_trace.py:_open_text() into a @contextmanager so mid-stream OSError failures during log iteration are caught and reported cleanly as TraceError.

Changes

  • tools/boot_trace.py (_open_text): Uses @contextlib.contextmanager and a with open(...) block inside try ... except OSError, guaranteeing file handle closure and wrapping iteration-time I/O errors into TraceError.
  • tests/test_boot_trace_read_error.py: Adds synthetic tests simulating mid-stream read OSError on both startup and D3D12 traces, verifying TraceError handling while preserving the healthy trace's summary.

Verification

  • AI-assisted; synthetic tests only, no game data (python -I scripts/check_no_game_data.py).

🔄 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/1124 **Author:** [@Taffyyy-ops](https://github.com/Taffyyy-ops) **Created:** 11/24/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/boot-trace-read-error` --- ### 📝 Commits (1) - [`75fc533`](https://github.com/ubiquitarianism/leonida/commit/75fc53309e78f3d293463a2cb8a0d149b2669db4) boot_trace: handle read errors during iteration (BOOT-TRACE-READ-ERROR) ### 📊 Changes **2 files changed** (+55 additions, -1 deletions) <details> <summary>View changed files</summary> ➕ `tests/test_boot_trace_read_error.py` (+51 -0) 📝 `tools/boot_trace.py` (+4 -1) </details> ### 📄 Description Item ID: `BOOT-TRACE-READ-ERROR` Converts `tools/boot_trace.py:_open_text()` into a `@contextmanager` so mid-stream `OSError` failures during log iteration are caught and reported cleanly as `TraceError`. ### Changes - **`tools/boot_trace.py` (`_open_text`):** Uses `@contextlib.contextmanager` and a `with open(...)` block inside `try ... except OSError`, guaranteeing file handle closure and wrapping iteration-time I/O errors into `TraceError`. - **`tests/test_boot_trace_read_error.py`:** Adds synthetic tests simulating mid-stream read `OSError` on both startup and D3D12 traces, verifying `TraceError` handling while preserving the healthy trace's summary. ### Verification - AI-assisted; synthetic tests only, no game data (`python -I scripts/check_no_game_data.py`). --- <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#1158
No description provided.