← Winnitude! Search  ·  Reader Mode (880 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 12 LINKS

AttributeError: 'NoneType' object has no attribute 'TerminateProcess' when accessing tree during iter_commits · Issue #2102 · gitpython-developers/GitPython

Repository navigation

AttributeError: 'NoneType' object has no attribute 'TerminateProcess' when accessing tree during iter_commits  #2102


New issue

New issue

Closed
#2105
Closed
AttributeError: 'NoneType' object has no attribute 'TerminateProcess' when accessing tree during iter_commits #2102 #2105 Labels
acknowledged

help wanted

Description

@MichaelJJ's profile MichaelJJ opened on Feb 19, 2026

GitPython version: 3.1.46

Given the following code:

def process_commits() -> None:
    repo = Repo(search_parent_directories=True)
    for commit in repo.iter_commits(max_count=10):
        print(commit.hexsha)
        commit.tree / "file.yml"

if __name__ == "__main__":
    process_commits()

Upon exiting the python script, the following error occurs:

Exception ignored in: <function _AutoInterrupt.__del__ at 0x000002B181033CE0>
Traceback (most recent call last):
  File ".venv\Lib\site-packages\git\cmd.py", line 376, in __del__
  File ".venv\Lib\site-packages\git\cmd.py", line 367, in _terminate
  File "C:\Program Files\Python312\Lib\subprocess.py", line 1673, in terminate
AttributeError: 'NoneType' object has no attribute 'TerminateProcess'

The error does not occur if the commit.tree call is commented out.

Metadata

Metadata

Assignees

No one assigned

    Labels


    acknowledged

    help wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions