[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2021-04-23 Thread Steve Dower
Steve Dower added the comment: Thanks for persisting with this change. Looks like backports will have to be manual, and I'm not going to get to them today myself, but if someone else wants to do it then feel free. I'm pretty sure this won't have any (negative) visible impact, but just in

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2021-04-23 Thread Steve Dower
Steve Dower added the comment: New changeset 5e437fb872279960992c9a07f1a4c051b4948c53 by Segev Finer in branch 'master': bpo-30555: Fix WindowsConsoleIO fails in the presence of fd redirection (GH-1927) https://github.com/python/cpython/commit/5e437fb872279960992c9a07f1a4c051b4948c53

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2021-03-15 Thread Eryk Sun
Eryk Sun added the comment: PR 1927 is a definite improvement. By using _get_osfhandle() instead of caching the handle value, it guarantees that access to the original console file can be saved and restored via `fd_save = dup(fd)` and `dup2(fd_save, fd)`. It also allows duping a new open of

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2017-06-03 Thread Segev Finer
Changes by Segev Finer : -- pull_requests: +2007 ___ Python tracker ___ ___

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2017-06-02 Thread Steve Dower
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

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2017-06-02 Thread Segev Finer
Changes by Segev Finer : -- nosy: +eryksun ___ Python tracker ___ ___ Python-bugs-list

[issue30555] _io._WindowsConsoleIO breaks in the face of fd redirection

2017-06-02 Thread Segev Finer
New submission from Segev Finer: _WindowsConsoleIO works by taking the handle out of the file descriptors of the stdio handles (get_osfhandle) and reading/writing to it directly using ReadConsoleW/WriteConsoleW. The problem is that some Python code wants to do file descriptor level