-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Rich 12.0.0 fails to write to stdout attached to a pipe on Windows #2053
Comments
Thanks. Will take a look. |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
OK with 51121fe installed bug.py is working correctly, but there's still three more situations which are crashing or working strangely 🙁
|
@ichard26 Thanks for investigating in such detail, and for the examples. It really helps! I'll take a look into these issues shortly 👍 |
Did I solve your problem? Why not buy the devs a coffee to say thanks? |
Can confirm all reported cases are fixed on master, many thanks! @darrenburns |
Describe the bug
Since rich 12.0.0, printing to stdout fails running under a subprocess attached to a pipe on Windows.
To reproduce, save the following reproducer and run it first with rich==12.0.0
There's a few observations here:
Platform
Python: CPython 3.8.5
OS: Windows 10 Home 21H2 (build 19044.1526)
Terminal: Windows Terminal 1.11.3471.0
rich.diagnose
Additional context
This was discovered by GHA Windows CI (the problem is hidden and buried in this test, but this shows it has been reproduced under several environments1). Original investigation into this strange behaviour happened in the #black-formatter channel on Python Discord.
According to @jack1142 who helped me investigate it, it's related to the recent move to replace colorama with first-party code that interacts with the Windows APIs:
They then shared this excerpt from Windows console API documentation:
Footnotes
if you're curious, it's basically testing whether recording the output (via
Console(record=True)
) and then dumping it as HTML works as expected with the rest of the tool ↩The text was updated successfully, but these errors were encountered: