git-for-windows/git-sdk-64

Python hangs in git bash terminal

bebob2 opened this issue · 4 comments

Once I install Python 3.8 from the official website and run python command from git bash shell it hangs.
There for, i suggest to include Python in the aliases.sh script.

Same issue on my end, running python hangs in Git Bash for Windows 10 (without possibility to CTRL-C), but python -V works well (and returns Python 3.9.0).

dscho commented

Isn't this what the Release Notes specifically talk about?

  • 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).

Python console needs to be started as winpty python instead of just python

I can confirm that after upgrading Git for Windows to v2.43 that this does not work:

winpty python

Even noting the alias, and avoiding it:

$type python
python is aliased to `winpty -Xallow-non-tty python.exe'

And finding the source location of python, python3, python3.8:

 $which python
/c/Users/jason/AppData/Local/Microsoft/WindowsApps/python

winpty still does not work in any manner.
This only happened after I upgraded Git for Windows to 2.43:

$ git update-git-for-windows
Git for Windows 2.43.0.windows.1 (64-bit)
Up to date

This corrected the issue for me:

I installed (after first uninstalling 3.8) Python 3.12.1 from:

Either works for me now:

$type python
python is aliased to `winpty -Xallow-non-tty python.exe'
$python
...or...
$winpty python