[docs] [issue18553] os.isatty() is not Unix only

Dmi Baranov report at bugs.python.org
Thu Sep 19 16:47:28 CEST 2013

Dmi Baranov added the comment:

I found a little difference in isatty implementaions:

Determines whether a file descriptor is associated with a character device [1]

Test whether a file descriptor refers to a terminal [2]

So, we having a same behavior for pipes, but different for I/O redirection with pseudo-character devices:

$ ./python -c "import os;print(os.isatty(0))" < /dev/null

e:\PCbuild>python_d.exe -c "import os;print(os.isatty(0))" < NUL

Other pseudo devices works simular:
e:\PCbuild>python_d.exe -c "import os;print(os.isatty(0))" < CON

I having a snippet to fix that, should I open a new issue for patch?

[1] http://msdn.microsoft.com/en-us/library/f4s0ddew.aspx
[2] http://man7.org/linux/man-pages/man3/isatty.3.html


Python tracker <report at bugs.python.org>

More information about the docs mailing list