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 Kit Yan Choi
Recipients Kit Yan Choi
Date 2017-06-21.16:06:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Given a zipfile with the following content:


    >>> archive = ZipFile(file_path, "r")
    >>> f ="subdir/", "r")

It is quite odd that the subdirectory can be opened as if it was an empty file.  One would expect it to raise.

One use case is that the archive is created using shutil.make_archive, which includes the subdirectory paths in the namelist.  Upon looping ZipFile.namelist(), you end up opening a subdirectory and getting the empty content, which should have led to error and prompted the developers to filter the namelist first.
Date User Action Args
2017-06-21 16:06:47Kit Yan Choisetrecipients: + Kit Yan Choi
2017-06-21 16:06:47Kit Yan Choisetmessageid: <>
2017-06-21 16:06:47Kit Yan Choilinkissue30724 messages
2017-06-21 16:06:47Kit Yan Choicreate