Eryk Sun <eryk...@gmail.com> added the comment:

> WindowsConsoleIO doesn't actually use the standard file descriptors 
> for stdin/out/err

To resolve bpo-30555, _WindowsConsoleIO was changed to eliminate self->handle 
and get the underlying handle dynamically via _get_osfhandle(). It's thus 
susceptible to close() and dup2() calls in Python or a C library. This 
consequence was noted. The alternative was to duplicate the OS handle that 
self->fd wraps, isolating it from self->handle. But then self->fd could get 
closed, or duped to another file. Either way there are file and file-type sync 
problems. It's not going to work in the seamless way that people are used to in 
POSIX, which only uses a single io.FileIO type. I think a better resolution 
will be possible in the context of your side project, if you're still working 
on it...

----------

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

Reply via email to