Skip to content

Conversation

@aisk
Copy link
Contributor

@aisk aisk commented Jan 26, 2026

WaitForSingleObject.argtypes = [HANDLE, DWORD]
WaitForSingleObject.restype = DWORD

OutHandle = GetStdHandle(STD_OUTPUT_HANDLE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GetStdHandle can return INVALID_HANDLE_VALUE and should be checked, too?

@chris-eibl
Copy link
Member

chris-eibl commented Jan 26, 2026

In general this lgtm. I've built locally and did a few very basic manual tests like redirecting stdout / stderr.
The changes where raise WinError(GetLastError()) are replaced with raise WinError(get_last_error()) are definitely ok, because we've also raised before and now won't just show the misleading

OSError: [WinError 0] The operation completed successfully.

anymore (#132962 (comment)).

But turning the silent swallowing into raising exceptions might bite us (although most probably the right thing to do), like you've seen in the failing tests in headless mode.

Most probably the swallowing just let another error surface slightly later, anyway, so I think it is ok to fail early and loud?

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants