Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Random git.repo.base.Repo.__del__ exceptions #610

Closed
@xsteve

Description

@xsteve

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 189def 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 closeAttributeError: '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 closeTypeError: '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 closeAttributeError: '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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp