I'm using mintty via Git-for-Windows and CPython35-32. Why does Python think it's not attached to a terminal?
$ python -c "import sys; print(sys.stdout.isatty())"
False
Interestingly, I also have a problem that I can not start an interactive session of Python inside the mintty. It might be related to this issue
$ python
<nothingness here...>
mintty's console emulation uses pipes to emulate a tty behind the scenes which confuses native programs checking to see if they are attached to a tty. In your case Python's isatty() sees stdout as being attached to pipe due to the fake tty and returns False.
This is another example of mintty issue #56 - Improve support for native console programs. The mintty wiki entry "Input/Output interaction with alien programs" points out you can work around the problem by using a wrapper like winpty when running the problem program within mintty.
The git commits mentioned by @vonc only work around the problem in the git program itself - they won't impact other programs (such as Python running in git-for-window's mintty) which would need to implement git's workaround in their own source.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With