Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
cmd.py: AutoInterrupt.__del__: Avoid some unwanted tracebacks by catching some more errors#576
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
…hing some more errors
codecov-io commentedFeb 1, 2017
Codecov Report@@ Coverage Diff @@## master #576 +/- ##==========================================+ Coverage 93.12% 94.47% +1.35%========================================== Files 63 63 Lines 9932 9937 +5 ==========================================+ Hits 9249 9388 +139+ Misses 683 549 -134
Continue to review full report at Codecov.
|
Thanks for the PR. As the code is terrible enough as it is, I believed it would be a better solution to just not try to use TASKKILL unless we are on windows, which should fix your problem. Maybe this fixes your problem already, and if not, some more exception handling might indeed be needed, just because Python really is a mess when shutting down its own process. |
I found some time to test your improvement. However now I see another class of errors. I have described them in issue#610 |
I see the following in an application that uses GitPython:
When the application raises an unknown exception it terminates with sys.exit(2)
When the exception is raised by GitPython I see that I land in the following line (although my application is running on Linux):
call(("TASKKILL /F /T /PID %s 2>nul 1>nul" % str(proc.pid)), shell=True)
Here I get the following exception (not always but in some cases):
Exception ignored in: <bound method GitRepository.del of <GitRepository '/big/yocto/msc-ldk'>>
Traceback (most recent call last):
File "/home/srei/work/git/GitPython/git/repo/base.py", line 182, indel
File "/home/srei/work/git/GitPython/git/cmd.py", line 965, in clear_cache
File "/home/srei/work/git/GitPython/git/cmd.py", line 265, indel
File "/usr/lib/python3.4/subprocess.py", line 537, in call
TypeError: 'NoneType' object is not callable
I took a look at the attribute error exception: it was the following:
'NoneType' object has no attribute 'SIGTERM'
I fixed this problem by wrapping the call line in a try: except block
However there remained another problem (that happened also only in rare cases):
Exception ignored in: <bound method GitRepository.del of <GitRepository '/big/yocto/msc-ldk'>>
Traceback (most recent call last):
File "/home/srei/work/git/GitPython/git/repo/base.py", line 182, indel
File "/home/srei/work/git/GitPython/git/cmd.py", line 967, in clear_cache
File "/home/srei/work/git/GitPython/git/cmd.py", line 254, indel
File "/usr/lib/python3.4/subprocess.py", line 1686, in terminate
File "/usr/lib/python3.4/subprocess.py", line 1681, in send_signal
TypeError: an integer is required (got type NoneType)
I fixed this one by adding a general except for proc.terminate and proc.wait
It would be really great when you would merge this improvement. These sporadic tracebacks are really annoying