- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 934
Failure to run as Windows Service ( [WinError 6] on subprocess.Popen ) #722
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
Comments
Thanks a lot for the summary! It looks like a simple change that could easily become a PR. The only problem might be that |
FWIW, we are experiencing the flood of similar issues on windows in DataLad. Unfortunately I do not see a permalink to the appveyor log, so here is a sample of tracebacks:
On a quick try the aforementioned trick with stdin didn't help. |
While configuring a working application to be run via a Windows Service (Windows 7) ( via nssm ), the application was failing (only when ran as a Windows Service) with:
After debugging the issue a bit, the problem was coming from the Popen call in Git.execute() - throwing Exception '[WinError 6] The handle is invalid'
The issue / workaround is described here (see stackoverflow link) - subprocess throws exception where it fails to find std-in handle with argument stdin=None to Popen().
Using the same work around from the link corrected my issue running as a Windows Service:
The work-around, was to add something like the stdout_sink for stdin (see below) prior to calling Popen() within Git.execute():
Not sure this if is the best solution, but it allows me to use GitPython running as Windows Service.
The text was updated successfully, but these errors were encountered: