◐ Shell
clean mode source ↗

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

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.