tartley / colorama

Simple cross-platform colored terminal text in Python
BSD 3-Clause "New" or "Revised" License
3.54k stars 251 forks source link

ANSI codes instead of colors when pytest imports colorama through conftest.py #114

Open grovduck opened 7 years ago

grovduck commented 7 years ago

I had reported this as an issue at pytest, but it's probably more likely an issue with colorama. The gist of the issue is that when a user has a custom pytest conftest.py file used which, in turn, imports colorama, the handles dictionary within win32.py does not get reparsed on the second import. I've suggested a possible fix in that ticket, but will defer to your judgment on how best to fix it. Thanks for looking at it.

segevfiner commented 7 years ago

This is caused by importing colorama with pytest's fd redirection active. I implemented a workaround for this here https://github.com/pytest-dev/pytest/pull/2611.