Redirecting or capturing output creates empty file or content
### Rationale This was discovered while attempting to write the output to a text file for further processing. No content is written to the file. The environment is Python 3.13.9 running on Windows 11 (Version 10.0.26100.6899) within a normal command prompt. This was tested with pre-commit-update 0.8.0 Steps to reproduce: 1. Open a **Terminal Command Prompt** window. 2. Navigate to project folder. 3. Run the command: `pre-commit-update --dry-run > output.txt` 4. Result is zero length file _output.txt_ The same results occur when trying to run using Python **subprocess.run** or **Popen**. Multiple variations have been tried, each of which exhibits the same behaviour. For example: ```python import subprocess with subprocess.Popen(["pre-commit-update", "--dry-run"], stdout=subprocess.PIPE) as p: print(f"Result: {p.wait()}") if p.stdout: data = p.stdout.read() print(f"Stdout: {data}") ``` This results in output similar to the following: ``` Changes detected Result: 1 Stdout: b'' ``` ### Type (select one) - [x] Bug - [ ] Feature request - [ ] Suggestion ### Pre-submit criteria - [x] No similar issue/feature request/suggestion exists
issue