This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jaraco
Recipients dstufft, jaraco, lukasz.langa, ned.deily, steve.dower
Date 2020-06-09.20:29:34
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1591734575.75.0.438922392383.issue40924@roundup.psfhosted.org>
In-reply-to
Content
This issue stems from improper reliance on implementation details of `importlib.resources.path`, which returns a context manager that is designed to clean up the file after the context closes. certifi would have encountered the same problem on older Pythons if certifi had been installed as a zip egg or other non-filesystem-based package.

That said, it is also undesirable for path no longer to return a reference to an existing path when one exists. That behavior has come about as the importlib.resources API moves from the legacy implementation to the new one based on TraversableResources (files function).

I encountered [a similar issue](https://github.com/python/cpython/pull/20576#issuecomment-637881341) during the original submission, which I addressed by removing the same assumption from another library (importlib.metadata).

I believe the best fix here is to restore that assumption while retaining other important changes in this patch. Should this assumed behavior also be tested (guaranteed)? That I'm less sure about.

> Please respect the beta feature freeze.

I do respect the beta feature freeze. The relevant feature was added prior to b1. The reverted change is an incremental fix addressing underlying implementation details such as how resources are resolved and removing duplicate code paths.

More importantly, the change also addresses a [key interface problem](https://github.com/python/cpython/pull/20576#issuecomment-639954228) that I identified in b1 - that the previously advertised interface of `loaders` supplying `files()` methods is inadequate.

I've put a lot of effort into pulling this all together for 3.9 (three full days just this past weekend and hundreds of hours leading up to that). It would be a real shame for it to be released in a broken state due to a minor (though admittedly impactful) hiccup.

I suspect there's a small change that to the submitted patch that will restore the prior expectation and leave the codebase in a healthier state.

I'll prepare that soon.
History
Date User Action Args
2020-06-09 20:29:35jaracosetrecipients: + jaraco, ned.deily, lukasz.langa, steve.dower, dstufft
2020-06-09 20:29:35jaracosetmessageid: <1591734575.75.0.438922392383.issue40924@roundup.psfhosted.org>
2020-06-09 20:29:35jaracolinkissue40924 messages
2020-06-09 20:29:34jaracocreate