]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
bpo-41490: ``path`` and ``contents`` to aggressively close handles (#22915)
authorJason R. Coombs <jaraco@jaraco.com>
Sun, 25 Oct 2020 18:21:46 +0000 (14:21 -0400)
committerGitHub <noreply@github.com>
Sun, 25 Oct 2020 18:21:46 +0000 (14:21 -0400)
commitdf8d4c83a6e1727e766191896aeabde886979587
treea286f28927d1cd736787880784d2c1af908b45b8
parentc32f2976b8f4034724c3270397aa16f38daf470f
bpo-41490: ``path`` and ``contents`` to aggressively close handles (#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.
Lib/importlib/_common.py
Lib/importlib/readers.py
Lib/importlib/resources.py
Lib/test/test_importlib/test_resource.py
Lib/test/test_importlib/zipdata01/ziptestdata.zip
Lib/test/test_importlib/zipdata02/ziptestdata.zip
Misc/NEWS.d/next/Library/2020-10-23-08-54-47.bpo-41490.-Yk6OD.rst [new file with mode: 0644]