Steve Dower <steve.do...@python.org> added the comment:
> I suppose checking the file type in io._WindowsConsoleIO.isatty() could be > useful in case the file descriptor gets reassigned to a non-console file > (e.g. via os.close or os.dup2). Pretty sure we currently don't support these anyway. WindowsConsoleIO doesn't actually use the standard file descriptors for stdin/out/err - it creates new ones based on the real handles just in case a caller requests them. In my opinion, correctness of "write to console" outweighs correctness of "manually close the console FD and wait for a new one with the same number to be opened" ;) If we have WindowsConsoleIO as the type, it shouldn't be possible for it to refer to any kind of file other than the console or it would be a FileIO. If that's no longer true, we should fix that first. WindowsConsoleIO.isatty ought to be "return True". ---------- _______________________________________ 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