Steve Dower added the comment:

> We can also switch to calling _get_osfhandle always instead of caching the 
> handle, it will break when the fd is redirected to a non-console. But so does 
> _WindowsConsoleIO in general since it will try to continue writing to the 
> console despite the redirection, meaning that Python code doing redirection 
> has to handle sys.std* anyhow.

This might be the best approach, ultimately. I bet there's an optimization 
here, though it's not obvious.

Probably the main issue here is readline not properly handling sys.std*. If 
that was fixed, I think many of these problems (at least at the interactive 
prompt) would simply go away.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue30555>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to