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
Default configuration does not look great for Windows users #232
Comments
Is this a regression? I.e. does 19.1.0 look fine everything else being equal? |
Yes, this is a regression. Maybe 3b534af 👀 |
Yeah, me too! Could you double-check if colorama.init() is called at all please? |
|
Oof. WTF then? |
It might be the print logger needs to reacquire sys.stdout after colorama init. But I'm not a Windows user personally, so not too sure - just guessing here. When I get back on a windows box I can bisect it .. |
OK just to be sure and before I start pulling people into this – could you please:
thanks! |
|
Confirming @wimglenn observation, after moving to the colorama lazy init, The issue is only with Windows, all good with Linux, but can't debug the Linux process right now to understand the init difference. Could it be that currently there is simply no rewriting by colorama required for Linux and that's why it also works fine without wrapped colorama stream for any terminal accepting a TTY? According to https://github.com/tartley/colorama |
I did some debugging, and can confirm that 3b534af is in fact the commit that broke the behavior. Here's why:
I see two ways forward:
To me, reverting 3b534af seems to be the more appropriate and efficient approach. |
Ugh but both are terrible. :( One looks bad on Windows, the other has an unavoidable import side-effect :( |
* Don't be lazy on Windows Fixes #232 * Add PR #
It prints escape sequences to terminal.
Python 3.8.0
colorama v0.4.1
structlog v19.2.0
(in foreground is powershell, background is cmd.exe, Windows 10)
The text was updated successfully, but these errors were encountered: