Skip to content
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

Strange coloring failure with a subprocess call #112

Open
rlaphoenix opened this issue Nov 12, 2022 · 1 comment
Open

Strange coloring failure with a subprocess call #112

rlaphoenix opened this issue Nov 12, 2022 · 1 comment

Comments

@rlaphoenix
Copy link

rlaphoenix commented Nov 12, 2022

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:
Windows Terminal

PyCharm:
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

@rlaphoenix
Copy link
Author

rlaphoenix commented Nov 12, 2022

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: python/cpython#84315

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant