-
Notifications
You must be signed in to change notification settings - Fork 3k
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
colorama color doesn't reset properly when redirecting pip to stdout #6354
Comments
Can you see if this happened with version 18.1? |
This might be stating the obvious, but two possibilities occur to me. Either--
I also wonder if this is a bug in colorama vs. pip's use of it. |
This code is working fine and the lines below it aren't colored in RED. So it shouldn't be a colorama related issue. |
The example you provided doesn't tell me it's not a colorama issue. All it says to me is that one particular combination of calls may work in one setting. Have you looked at what API's pip is using to invoke colorama? Also, colorama's tracker seems to have a number of issues around Windows, various edge cases around TTY, redirection, etc. As one example, a very quick search yielded this issue, which seems similar to what you're reporting here (with title "Windows: Style.RESET_ALL does not work if stdout is redirected"): tartley/colorama#200 |
I tried to reproduce this issue tartley/colorama#200 , but it now no longer happening. Also, even if the issue occurs due to colorama, can't we apply a fix until the issue is fixed in colorama module. |
FYI, you didn't follow their instructions. You need to put those lines in a separate file and then execute from the command-line (not Python prompt).
The policy here would be to fix the issue in colorama. It seems like it would be doable to me, if I were to guess. |
I filed an issue for this in colorama's tracker here: tartley/colorama#218 |
Great, hope they fix it soon. |
Environment
Using system interpreter
Description
The command line in windows stays red after entering a certain incorrect command, not all commands give this error. This happens in CMD and Powershell, I can't say about Linux or Mac.
It looks like this issue had occurred before - #2817 (Closed)
Expected behavior
It is obvious, the expected behavior is that it should reset the colors back to white, after the error is over. Looks like someone forgot to reset in colorama.
How to Reproduce
Just type 'pip install > xyz' and this bug will appear. Also it only happens with the '>' symbol, and not with any other thing.
The text was updated successfully, but these errors were encountered: