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

AutoInterrupt is broken with Python 3.12.9 · Issue #2003 · gitpython-developers/GitPython

Repository navigation

AutoInterrupt is broken with Python 3.12.9  #2003


New issue

New issue

Closed
Bug
Closed
AutoInterrupt is broken with Python 3.12.9 #2003 Bug Labels
acknowledged

help wanted

Description

@ziyao233's profile ziyao233 opened on Feb 16, 2025

Refer to the comment , CPython is refactoring stdlib modules with lazy import, improving performance on loading.

Unfortunately, this breaks the AutoInterrupt wrapper in GitPython, whose finalizer makes use of subprocess.Popen.terminate(). After the refactor of subprocess module1 , the terminate() method may lazily load signal module, which is problematic if it is invoked during the interpreter finalization.

A real-world reproducer is the spdxcheck.py2 script in Linux kernel,

$ ./scripts/spdxcheck.py outgoing/clock/v3/v3-0001-dt-bindings-clock-Document-clock-and-reset-unit-o.patch 
Exception ignored in: <function Git.AutoInterrupt.__del__ at 0x7f25d89cd260>
Traceback (most recent call last):
  File "/usr/lib/python3.12/site-packages/git/cmd.py", line 790, in __del__
  File "/usr/lib/python3.12/site-packages/git/cmd.py", line 781, in _terminate
  File "/usr/lib/python3.12/subprocess.py", line 2220, in terminate
ImportError: sys.meta_path is None, Python is likely shutting down
Reacted by Rick van den Hof

Metadata

Metadata

Assignees

No one assigned

    Labels


    acknowledged

    help wanted

    Type

    Bug

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions