-
-
Notifications
You must be signed in to change notification settings - Fork 580
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
isort 5.11.0, NameError: name 'colorama' is not defined #2031
Comments
A workaround right now is to just install
Alternatively, you may need to add it as an additional download or dependency in your build pipeline, if (like me) you're experiencing this bug in your CI pipeline. |
|
5.11.1 is here. |
Can confirm that 5.11.1 solves the issue for me. Thanks for the quick response @staticdev! |
Thanks for the quick fix! |
Hello!
Bug overview
colorama.init
is always called increate_terminal_printer
, even ifcolorama_unavailable
is set to True andcolorama
is unavailable.Details
A Printer is initialized in this function:
isort/isort/format.py
Lines 138 to 156 in 6525008
As you can see,
colorama_unavailable
is a global variable in this context. It should be used to ensure thatcolorama
is not used if set to True. However, this is not done.How to reproduce
Ensure the following:
isort
at 5.11.0 (or at any point since Fix Rich compatibility #1961 / c1a4139)colorama
must not be downloaded.Then, any use of
isort --check-only demo.py
, withdemo.py
as an existing file, should trigger the following error:In the wild
See this Github Actions for the error in the wild.
The text was updated successfully, but these errors were encountered: