-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
git-bash giving unexpected results when called from Python's subprocess module #946
Comments
Please understand that What you most likely wanted to do was to call |
My question is really about why there are two completely different results for the same code between Git for Windows versions Git-2.10.1-64-bit vs Git-2.9.2-64-bit. I did intend to call the interactive Git Bash (as opposed to If I call In comparison, |
The source code has actually not changed between those releases. So my next guess was that maybe something in the MINGW CRT package changed that lets GUI processes quit early. I even went so far was to clone https://git.code.sf.net/p/mingw-w64/mingw-w64 mingw-w64-mingw-w64 before realizing that I should check whether the And when I was comparing the package versions of 2.9.3(2) vs 2.10.0, it struck me that preciously little had changed. But there was one notable jump there: the MinTTY version had jumped from 2.0.3 to 2.4.2. And a "bug fix" in MinTTY v2.1.3 quietly changed the startup behavior to "daemonize" by default, i.e. let the main process quit while the worker process continues to run. This comment reflects 5 hours of research. |
The `git-bash.exe` helper [now waits again for the terminal to be closed before returning](git-for-windows/git#946). Signed-off-by: Johannes Schindelin <[email protected]>
Setup
Git-2.10.1-64-bit
which was compared to the installed version:
defaults?
to the issue you're seeing?
Calling git-bash.exe from Python 2.7.12
Details
git-bash.exe
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Call from python
download_table.sh
For each call to subprocess to run sequentially downloading TABLE1, TABLE2, TABLE3 waiting for the current process to conclude before continuing.
All three processes were kicked off without waiting for the previous git-bash.exe process to terminate.
The above code was tested with Git-2.10.1-64-bit AND Git-2.9.2-64-bit. The latter yielded expected results whereas the newer version did not.
Calls to subprocess using \bin\sh.exe and \bin\bash.exe DID cause download_table.sh to be executed sequentially however these commands cause the script to be run without opening an external window therefore not allowing stdout to be read in real time (this is particularly an issue when
cmdargs
is then called from the multiprocessing library).URL to that repository to help us with testing?
The text was updated successfully, but these errors were encountered: