You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an exception is thrown the cleanup of Repo objects causes some very strange back traces.
When I run my test script several times. I have different results. Sometimes it works.
On other runs I have either the errors a), b) or c)
/work/GitPython/git/repo/base.py
def __del__(self):
self.close() # line 189
def close(self):
if self.git:
self.git.clear_cache()
gc.collect() # line 194
gitdb.util.mman.collect() # line 195
gc.collect()
a)
Exception ignored in: <bound method GitRepository.__del__ of <GitRepository '/big/yocto/msc-ldk'>>
Traceback (most recent call last):
File "/work/GitPython/git/repo/base.py", line 189, in __del__
File "/work/GitPython/git/repo/base.py", line 195, in close
AttributeError: 'NoneType' object has no attribute 'mman'
b)
Exception ignored in: <bound method GitRepository.__del__ of <GitRepository '/big/yocto/msc-ldk'>>
Traceback (most recent call last):
File "/work/GitPython/git/repo/base.py", line 189, in __del__
File "/work/GitPython/git/repo/base.py", line 194, in close
TypeError: 'NoneType' object is not callable
c)
Exception ignored in: <bound method GitRepository.__del__ of <GitRepository '/big/yocto/msc-ldk'>>
Traceback (most recent call last):
File "/work/GitPython/git/repo/base.py", line 189, in __del__
File "/work/GitPython/git/repo/base.py", line 194, in close
AttributeError: 'NoneType' object has no attribute 'collect'
One solution to get rid of the back traces is to wrap the self.close() call in a try-except handler:
def __del__(self):
try:
self.close()
except:
pass
The text was updated successfully, but these errors were encountered:
Thanks for providing all the details, and even the fix.
I took the liberty to implement it, and hope this will improve the situation (or even fix it :)).
When an exception is thrown the cleanup of Repo objects causes some very strange back traces.
When I run my test script several times. I have different results. Sometimes it works.
On other runs I have either the errors a), b) or c)
/work/GitPython/git/repo/base.py
a)
b)
c)
One solution to get rid of the back traces is to wrap the self.close() call in a try-except handler:
The text was updated successfully, but these errors were encountered: