← 返回首页
AutoInterrupt is broken with Python 3.12.9 · Issue #2003 · gitpython-developers/GitPython · GitHub
Skip to content

Navigation Menu

Toggle navigation
Sign in
Appearance settings
Search or jump to...

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

Provide feedback

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

Include my email address so I can be contacted

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Resetting focus

AutoInterrupt is broken with Python 3.12.9 #2003

New issue
New issue

Description

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Footer

      © 2026 GitHub, Inc.