-
-
Notifications
You must be signed in to change notification settings - Fork 30.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bpo-41490: path
and contents
to aggressively close handles
#22915
Conversation
I need to investigate why the zip test data changed. |
I see I refreshed those zips in python/importlib_resources@9342877, and this is the first sync since. |
Oh, that's interesting. |
…ences to the zipfile.
path
method to aggressively close handlespath
method to aggressively close handles
I don't want to apply the fix at |
…eagerly converted to a list if it's not already a sequence.
path
method to aggressively close handlespath
method to aggressively close handles
path
method to aggressively close handlespath
and contents
to aggressively close handles
self.zip_path.unlink() | ||
del c | ||
|
||
@unittest.skip("Desired but not supported.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should call out that this test is being skipped because it proved too difficult to support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is but the following one is not?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. I found a way to support this use-case, but only by not supporting the latter... and the latter was more important to certifi.
I'd like to proceed with merging this change. We can iterate or revert later as needed. |
@jaraco: Please replace |
…ython#22915) * bpo-41490: ``path`` method to aggressively close handles * Add blurb * In ZipReader.contents, eagerly evaluate the contents to release references to the zipfile. * Instead use _ensure_sequence to ensure any iterable from a reader is eagerly converted to a list if it's not already a sequence.
As found in importlib_resources 3.1.1.
https://bugs.python.org/issue41490
Automerge-Triggered-By: GH:jaraco