Bug report
Checklist
CPython versions tested on:
3.8, 3.9, 3.11
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
No response
A clear and concise description of the bug:
This simple example fully describe this bug
from zipfile import ZipFile
with ZipFile("archive.zip", "w") as archive:
archive.comment = b"PK\005\006" + b"\000" * 18 # Archive has a comment
with archive.open("file1", "w") as file: # -\
file.write(b"content") # |
# |
with archive.open("file2", "w") as file: # |
file.write(b"content") # |- 3 files
# |
with archive.open("file3", "w") as file: # |
file.write(b"content") # -/
with ZipFile("archive.zip") as archive:
assert archive.comment == b"PK\005\006" + b"\000" * 18 # Error - archie has no comment
assert len(archive.filelist) == 3 # Error - archive has no files
Bug report
Checklist
and am confident this bug has not been reported before
CPython versions tested on:
3.8, 3.9, 3.11
Operating systems tested on:
Linux
Output from running 'python -VV' on the command line:
No response
A clear and concise description of the bug:
This simple example fully describe this bug