Repository navigation
Closed
Labels
3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
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/warsaw'
closed_at = <Date 2018-01-24.20:38:34.046>
created_at = <Date 2017-12-07.21:12:39.855>
labels = ['3.7', 'type-feature', 'library']
title = 'Port importlib_resources (module and ABC) to Python 3.7'
updated_at = <Date 2018-01-24.20:38:34.044>
user = 'https://github.com/warsaw'bugs.python.org fields:
activity = <Date 2018-01-24.20:38:34.044>
actor = 'barry'
assignee = 'barry'
closed = True
closed_date = <Date 2018-01-24.20:38:34.046>
closer = 'barry'
components = ['Library (Lib)']
creation = <Date 2017-12-07.21:12:39.855>
creator = 'barry'
dependencies = []
files = []
hgrepos = []
issue_num = 32248
keywords = ['patch']
message_count = 19.0
messages = ['307824', '308435', '308495', '308501', '308586', '309251', '309253', '309490', '309563', '309579', '309582', '309646', '309647', '309789', '309875', '310144', '310174', '310628', '310629']
nosy_count = 8.0
nosy_names = ['twouters', 'barry', 'brett.cannon', 'gregory.p.smith', 'db3l', 'vstinner', 'eric.snow', 'zach.ware']
pr_nums = ['4892', '4911', '5108', '5138', '5209', '5213', '5248']
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue32248'
versions = ['Python 3.7']Metadata
Metadata
Assignees
Labels
3.7 (EOL)end of lifestdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement
Activity
warsaw commentedon Dec 7, 2017
We intend to port importlib_resources to Python 3.7 as importlib.resources, with a provisional API. There's also a ResourceReader ABC to include, along with documentation and tests.
Nosying Brett and assigning to myself, but if Brett *wants* to do the work, I won't stand in his way. :)
brettcannon commentedon Dec 16, 2017
New changeset 4ac5150 by Brett Cannon in branch 'master':
bpo-32248: Implement importlib.abc.ResourceReader (GH-4892)
4ac5150
warsaw commentedon Dec 17, 2017
I have the tests and code ported, but there are still a few things to do, but here's a question:
We're using type annotations in importlib_resources, which of course is the right decision. But I think we still have a moratorium on typing in the stdlib. So do we want to remove the types from importlib.resources?
Doing so could make for more work as we continue to track importlib_resource, so I'm inclined not to remove them.
warsaw commentedon Dec 17, 2017
PR 4911 implements the importlib.resources API, along with tests and documentation.
@brett.cannon - I'm thinking we should do the native ResourceReader implementations for the built-in loaders as a separate branch.
brettcannon commentedon Dec 18, 2017
Yep, I assumed implementing the ReourceReader API would be a separate step.
As for the type hints, I thought it was lifted such that new code could include it but we wouldn't be taking PRs to add them to pre-existing code?
warsaw commentedon Dec 30, 2017
New changeset deae6b4 by Barry Warsaw in branch 'master':
bpo-32248 - Implement importlib.resources (bpo-4911)
deae6b4
warsaw commentedon Dec 30, 2017
Next up - implementing the ResourceReader ABC.
db3l commentedon Jan 5, 2018
Apologies if this is obvious and already in progress, but the issue with Windows and this change appears to be that the "utf-8.file" file is being treated as text rather than binary.
So the line ending is expanding to CRLF. The working copy of utf-8.file on my Windows workers is actually 21 bytes, not 20.
zware commentedon Jan 6, 2018
I notice that my 'Installed' builder (http://buildbot.python.org/all/#/builders/103) has been broken since PR4911 landed. My suspicion is that it's just another directory missed in the Makefile install libinstall target, but haven't actually looked into it.
brettcannon commentedon Jan 6, 2018
I bet Barry forgot to add some test directories to the makefile.
On Sat, Jan 6, 2018, 10:33 Zachary Ware, <report@bugs.python.org> wrote:
warsaw commentedon Jan 6, 2018
On Jan 6, 2018, at 13:33, Zachary Ware <report@bugs.python.org> wrote:
Dang. I’ll try to look into this as soon as possible, but it might be a day or so.
vstinner commentedon Jan 7, 2018
Tests fail on Windows since the commit deae6b4.
Example with AMD64 Windows8.1 Non-Debug 3.x:
http://buildbot.python.org/all/#/builders/12/builds/426
======================================================================
FAIL: test_open_binary (test.test_importlib.test_open.OpenDiskTests)
----------------------------------------------------------------------
vstinner commentedon Jan 7, 2018
Failure on x86 Gentoo Installed with X 3.x:
http://buildbot.python.org/all/#/builders/103/builds/453
4 tests failed:
test_compileall test_import test_importlib test_inspect
warsaw commentedon Jan 11, 2018
@bbayles: I don't think PR 5149 is related to this issue.
brettcannon commentedon Jan 12, 2018
New changeset bca4218 by Brett Cannon in branch 'master':
bpo-32248: Introduce the concept of Loader.get_resource_reader() (GH-5108)
bca4218
vstinner commentedon Jan 17, 2018
New changeset 44a70e9 by Victor Stinner in branch 'master':
Fix Git attributes of test_importlib data files (bpo-5209)
44a70e9
vstinner commentedon Jan 17, 2018
New changeset 3a0cf93 by Victor Stinner in branch 'master':
bpo-32248: Fix test_importlib.test_open() (bpo-5213)
3a0cf93
warsaw commentedon Jan 24, 2018
New changeset 6f6eb35 by Barry Warsaw in branch 'master':
bpo-32248 - Implement
ResourceReaderandget_resource_reader()for zipimport (bpo-5248)6f6eb35
warsaw commentedon Jan 24, 2018
Now that the zipimporter support has landed, I think we're done!