Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python thinks stdin not connected to a TTY #2594

Closed
jkbrzt opened this issue Apr 20, 2020 · 2 comments
Closed

Python thinks stdin not connected to a TTY #2594

jkbrzt opened this issue Apr 20, 2020 · 2 comments

Comments

@jkbrzt
Copy link

jkbrzt commented Apr 20, 2020

Python running inside Git Bash incorrectly thinks that stdin is not connected to a TTY:

$ python3 -c 'import sys; print(sys.stdin.isatty())'
False  # Should be True

httpie/cli#828

https://docs.python.org/3/library/os.html?highlight=isatty#os.isatty

@dscho
Copy link
Member

dscho commented Apr 20, 2020

This issue is listed specifically in the Known Issues in our Release Notes:

  • Some console programs, most notably non-MSYS2 Python, PHP, Node and OpenSSL, interact correctly with MinTTY only when called through winpty (e.g. the Python console needs to be started as winpty python instead of just python).

The installer even suggests (on the page titled "Configuring the terminal emulator to use with Git Bash") to

Use Windows' default console window
[...] which works well with Win32 console programs such as interactive Python or node.js [...]

@jkbrzt
Copy link
Author

jkbrzt commented Apr 23, 2020

@dscho thank you for the explanation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants