◐ Shell
clean mode source ↗

Message 252437 - Python tracker

Serhiy, your patch looks like a worthwhile improvement because it adds proper error checking and handling. However I suspect this original bug is actually a side effect of Issue 24402. The code in question shouldn’t even be running, because sys.stdout is not the original output file descriptor, and is not a terminal.