[issue28654] sys.stdout.isatty() returns True even if redirected to NUL
Kuno Meyer added the comment: 2) Yes, it should be `> /dev/null` instead of `> /dev/nul` (my bad). The output remains the same. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28654> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28654] sys.stdout.isatty() returns True even if redirected to NUL
Kuno Meyer added the comment: http://stackoverflow.com/questions/3648711/detect-nul-file-descriptor-isatty-is-bogus, although a bit convoluted, might also help. It mentions GetConsoleMode() for stdin and GetConsoleScreenBufferInfo() for stdout. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28654> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28654] sys.stdout.isatty() returns True even if redirected to NUL
New submission from Kuno Meyer: [Python 3.5.2 on Windows] >py -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > NUL True NUL is the Windows equivalent of /dev/nul, so the result should probably be False. Under Cygwin, the result is as expected: $ python3 -c "import sys; print(sys.stdout.isatty(), file=sys.stderr)" > /dev/nul False -- components: Windows messages: 280494 nosy: kmeyer, paul.moore, steve.dower, tim.golden, zach.ware priority: normal severity: normal status: open title: sys.stdout.isatty() returns True even if redirected to NUL versions: Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28654> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com