Repository navigation
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
test_importlib started to fails with "env changed" on:
- AMD64 CentOS9 NoGIL Refleaks 3.x since https://buildbot.python.org/#/builders/1610/builds/4375
- ARM64 MacOS M1 Refleaks NoGIL 3.x: https://buildbot.python.org/#/builders/1368
Example on AMD64 CentOS9 NoGIL Refleaks 3.x: https://buildbot.python.org/#/builders/1610/builds/4375
test_lazy_self_referential_modules (test.test_importlib.test_lazy.LazyLoaderTests.test_lazy_self_referential_modules) ... ok
test_module_already_in_sys (test.test_importlib.test_lazy.LazyLoaderTests.test_module_already_in_sys) ... ok
test_module_load_race (test.test_importlib.test_lazy.LazyLoaderTests.test_module_load_race) ... ok
test_module_substitution_error (test.test_importlib.test_lazy.LazyLoaderTests.test_module_substitution_error) ... ok
test_mutated_attr (test.test_importlib.test_lazy.LazyLoaderTests.test_mutated_attr) ... ok
test_mutated_preexisting_attr (test.test_importlib.test_lazy.LazyLoaderTests.test_mutated_preexisting_attr) ... ok
test_new_attr (test.test_importlib.test_lazy.LazyLoaderTests.test_new_attr) ... ok
test_deadlock (test.test_importlib.test_locks.Frozen_DeadlockAvoidanceTests.test_deadlock) ... Warning -- Unraisable exception
Exception ignored while finalizing file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example-21.12-py3.6.egg' mode='rb' closefd=True>:
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/support/__init__.py", line 1004, in gc_collect
gc.collect()
~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example-21.12-py3.6.egg' mode='rb' closefd=True>
Warning -- Unraisable exception
Exception ignored while finalizing file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example-21.12-py3-none-any.whl' mode='rb' closefd=True>:
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/support/__init__.py", line 1004, in gc_collect
gc.collect()
~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example-21.12-py3-none-any.whl' mode='rb' closefd=True>
Warning -- Unraisable exception
Exception ignored while finalizing file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example2-1.0.0-py3-none-any.whl' mode='rb' closefd=True>:
Traceback (most recent call last):
File "/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/support/__init__.py", line 1004, in gc_collect
gc.collect()
~~~~~~~~~~^^
ResourceWarning: unclosed file <_io.FileIO name='/home/buildbot/buildarea/3.x.itamaro-centos-aws.refleak.nogil/build/Lib/test/test_importlib/metadata/data/example2-1.0.0-py3-none-any.whl' mode='rb' closefd=True>
ok
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtopic-free-threadingtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
cmaloney commentedon Nov 21, 2026
Existing unclosed file was made visible by a finalization order change that gh-161184 caused.
importlib.metadata.FastPathcan contain azipfile.Pathwhich keeps alive aBufferedReader.Working on a PR.
gh-162342: Close cached zip files in importlib.metadata test fixtures (…