python-coloredlogs
python-coloredlogs copied to clipboard
Strange coloring failure with a subprocess call
If I make a subprocess call (of any kind, Popen, run, check_call, check_output, e.t.c) it will break the coloring of every single further log.
Windows Terminal:

PyCharm:

You can see that I added test1 and test2 logs before and after the subprocess call and only test2 broke.
I have no idea why this is happening. I've also tried run() with stdout and stderr redirected to subprocess.DEVNULL, and it still happens.
The relevant line of code can be found here:
https://github.com/rlaphoenix/nton/blob/ccf9dbfcbb5ea25849733630173e96bf27062132/nton/main.py#L220
A member of TPH has given me a tip of using os.system("") and it did in fact work. But why is the question? Seems he also needed to use this a few times as well.
Likely relevant issue: https://github.com/python/cpython/issues/84315