[issue23991] ZipFile sanity checks

2021-11-27 Thread Antony Lee


Change by Antony Lee :


--
nosy:  -Antony.Lee

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23991] ZipFile sanity checks

2021-11-27 Thread Irit Katriel


Irit Katriel  added the comment:

I get NotADirectory errors now, I believe they were added in issue40564.

--
nosy: +iritkatriel
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Using zipfile.Path with several files prematurely closes zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23991] ZipFile sanity checks

2015-04-18 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +alanmcintyre, serhiy.storchaka, twouters

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23991
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue23991] ZipFile sanity checks

2015-04-17 Thread Antony Lee

New submission from Antony Lee:

ZipFile.{open,read} could raise IsADirectoryError when called on a directory 
entry, rather than return an empty bytes.
ZipFile.writestr could fail writing non-empty bytes to a directory entry.

Use case for open and read: I was trying to write a zip merger (taking multiple 
zip files and merge them into a single zip).  Unfortunately, the obvious 
approach (iterate on the original infolists, extract each of them and writestr 
them to the new ZipFile object) created invalid zip files because it'll create 
empty files for each directory.  Raising IsADirectoryError would have brought 
attention to the issue much earlier.

The suggested modification to writestr is a bit different, but also makes sense 
because the bytes argument is not written anywhere anyways in the case of 
directory entries.

--
components: Library (Lib)
messages: 241396
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: ZipFile sanity checks
versions: Python 3.4, Python 3.5

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23991
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com