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 bustawin
Recipients bustawin
Date 2020-05-08.15:47:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Given a .zip file with more than one inner file, when reading those inner files using zipfile.Path the zip module closes the .zip file prematurely, causing an error.

Given the following code (example zipfile is attached, but any should work).

with zipfile.ZipFile('') as file:
    for name in ['file-1.txt', 'file-2.txt']:
        p = zipfile.Path(file, name)
        with as inner:
            print(list(inner)) # ValueError: seek of closed file

But the following code does not fail:

with zipfile.ZipFile('') as file:
    for name in ['file-1.txt', 'file-2.txt']:
        with as inner:
            print(list(inner)) # Works!

Python 3.8.2 macOS 10.15.4.
Date User Action Args
2020-05-08 15:47:01bustawinsetrecipients: + bustawin
2020-05-08 15:47:01bustawinsetmessageid: <>
2020-05-08 15:47:01bustawinlinkissue40564 messages
2020-05-08 15:47:01bustawincreate