Skip to content

Fix Windows ANSI initialization using STD_OUTPUT_HANDLE constant (#721) - #727

Open
Fire162 wants to merge 1 commit into
google:masterfrom
Fire162:fix/windows-ansi-std-output-handle
Open

Fire162 wants to merge 1 commit into
google:masterfrom
Fire162:fix/windows-ansi-std-output-handle

Conversation

@Fire162

@Fire162 Fire162 commented Oct 29, 2026

Copy link
Copy Markdown

Summary

In fire/formatting_windows.py, initialize_or_disable() referenced subprocess.STD_OUTPUT_HANDLE. The subprocess module does not expose this attribute, which leads to an AttributeError when the Windows 10 native ANSI initialization path executes.

This defines the Win32 standard output handle constant STD_OUTPUT_HANDLE = -11 in fire/formatting_windows.py and removes the unused subprocess import.

Changes

  • Defined STD_OUTPUT_HANDLE = -11 in fire/formatting_windows.py and passed it to kernel32.GetStdHandle().
  • Removed unused import subprocess from fire/formatting_windows.py.
  • Added unit tests in fire/formatting_test.py validating STD_OUTPUT_HANDLE and verifying the mocked Windows 10 console initialization flow.

Fixes #721

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows ANSI initialization uses nonexistent subprocess.STD_OUTPUT_HANDLE

1 participant