Repository navigation
New files() api from importlib_resources. #83972
Copy link
Copy link
Closed
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = 'https://github.com/jaraco'
closed_at = <Date 2020-12-09.23:47:15.564>
created_at = <Date 2020-02-29.04:11:30.709>
labels = ['type-bug', 'library', '3.9']
title = 'New `files()` api from importlib_resources.'
updated_at = <Date 2021-02-22.00:21:55.488>
user = 'https://github.com/jaraco'bugs.python.org fields:
activity = <Date 2021-02-22.00:21:55.488>
actor = 'vstinner'
assignee = 'jaraco'
closed = True
closed_date = <Date 2020-12-09.23:47:15.564>
closer = 'jaraco'
components = ['Library (Lib)']
creation = <Date 2020-02-29.04:11:30.709>
creator = 'jaraco'
dependencies = []
files = []
hgrepos = []
issue_num = 39791
keywords = ['patch']
message_count = 17.0
messages = ['362962', '363556', '368484', '368490', '370782', '370790', '370825', '370834', '370840', '370903', '370904', '370945', '370947', '371074', '371131', '371744', '382812']
nosy_count = 9.0
nosy_names = ['barry', 'nascheme', 'nascheme', 'jaraco', 'ned.deily', 'lukasz.langa', 'Michael.Felt', 'miss-islington', 'hauntsaninja', 'benthayer']
pr_nums = ['19722', '20576', '20656', '20659', '20661', '20662', '20681', '20695', '20703', '20760', '20938', '23715', '24612', '24612']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue39791'
versions = ['Python 3.9']Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
3.9 (EOL)end of lifeend of lifestdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Activity
jaraco commentedon Feb 29, 2020
In the importlib_resources backport... in particular in issue 58 and merge request 76, the backport now has a new feature, a "files()" function.
Let's incorporate that functionality into importlib.resources.
jaraco commentedon Mar 6, 2020
The latest release, 1.3.0, includes extensibility support and has been merged with the cpython branch of the importlib_resources project. I believe that code is now synced with this project and ready to be applied here. I'm hoping benthayer can apply the changes and submit the pr.
jaraco commentedon May 8, 2020
New changeset 7f7e706 by Jason R. Coombs in branch 'master':
bpo-39791: Add files() to importlib.resources (GH-19722)
7f7e706
jaraco commentedon May 8, 2020
I've merged PR 19722. Some follow up actions I'd like to do:
.files()on built-in loaders.loader.get_resource_reader()with adapters around.files()for built-in loaders.jaraco commentedon Jun 5, 2020
New changeset 161541a by Jason R. Coombs in branch 'master':
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659)
161541a
jaraco commentedon Jun 5, 2020
New changeset a4fa9a9 by Miss Islington (bot) in branch '3.9':
bpo-39791: Refresh importlib.metadata from importlib_metadata 1.6.1. (GH-20659) (GH-20661)
a4fa9a9
aixtools commentedon Jun 6, 2020
The 'fancy' file name breaks on latin-1 character set.
AIX bots fail with:
Captured traceback
==================
Test report
===========
Failed tests:
jaraco commentedon Jun 6, 2020
Thanks for the report Michael. I'm trying to figure out the best way to address the issue. That test is shared with importlib_metadata, so needs to run without CPython's test suite fixtures, such as the ones that generate non-ascii filenames. I'm tempted to just attempt to create the fixture and skip if the fixture fails. An alternate approach might be to attempt to load CPython's fixture, skip if that value is None, and fallback to the snowman otherwise.
jaraco commentedon Jun 6, 2020
See #64880 for a proposed fix. I've scheduled the build bots to run the patch. Will build bots prove the fix? If not, can you test the patch in the same environment where it was discovered?
jaraco commentedon Jun 7, 2020
New changeset 2efe18b by Jason R. Coombs in branch 'master':
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (bpo-20681)
2efe18b
miss-islington commentedon Jun 7, 2020
New changeset 71f5016 by Miss Islington (bot) in branch '3.9':
bpo-39791: Support file systems that cannot support non-ascii filenames (skipping tests in that case). (GH-20681)
71f5016
jaraco commentedon Jun 8, 2020
New changeset 843c277 by Jason R. Coombs in branch 'master':
bpo-39791 native hooks for importlib.resources.files (GH-20576)
843c277
miss-islington commentedon Jun 8, 2020
New changeset 9cf1be4 by Miss Islington (bot) in branch '3.9':
bpo-39791 native hooks for importlib.resources.files (GH-20576)
9cf1be4
ned-deily commentedon Jun 9, 2020
Note that the most recent commits have introduced a critical regression in importlib.resources.path() that breaks the certifi package from PyPI and presumably other users of path(). See bpo-40924.
ambv commentedon Jun 9, 2020
New changeset ce5e6f0 by Łukasz Langa in branch '3.9':
[3.9] bpo-40924: Revert "bpo-39791 native hooks for importlib.resources.files (GH-20576)" (bpo-20760)
ce5e6f0
vstinner commentedon Jun 17, 2020
This change introduced bpo-41007 "test_importlib logs ResourceWarning: test_path.CommonTests.test_importing_module_as_side_effect()" regression.
jaraco commentedon Dec 9, 2020
This issue was implemented, just not as fully as I'd have hoped. Still lacking is native support for .files on the built-in package providers and removing the legacy APIs or at least configuring them to rely on the files API, but as far as supplying the files API, this work is done.