cpython
cpython copied to clipboard
Sync with importlib_metadata for Python 3.13
This issue tracks incorporating updates from importlib_metadata into CPython for Python 3.13, including:
Linked PRs
- gh-117092
- gh-117094
As I started looking into what it would take to move the tests from Lib/test/test_importlib to Lib/test/test_importlib/metadata, I found that there are more instances of the mod module leaking across tests, so I'll need to deal with that too.
ERROR: test_module_resources (test.test_importlib.resources.test_files.ModulesFilesTests.test_module_resources)
A module can have resources found adjacent to the module.
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Users/jaraco/code/python/cpython/Lib/test/test_importlib/resources/test_files.py", line 88, in test_module_resources
actual = resources.files(mod).joinpath('res.txt').read_text(encoding='utf-8')
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "/Users/jaraco/code/python/cpython/Lib/pathlib/__init__.py", line 568, in read_text
return _abc.PathBase.read_text(self, encoding, errors, newline)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jaraco/code/python/cpython/Lib/pathlib/_abc.py", line 743, in read_text
with self.open(mode='r', encoding=encoding, errors=errors, newline=newline) as f:
~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/jaraco/code/python/cpython/Lib/pathlib/__init__.py", line 559, in open
return io.open(self, mode, buffering, encoding, errors, newline)
~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/f2/2plv6q2n7l932m2x004jlw340000gn/T/tmpbuigpc61/res.txt'
I found tmpbuigpc61 was left over from metadata tests.
Triage: I think this is ready to be closed.