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.

classification
Title: zipfile.is_zipfile returns true for a rar file containing zips
Type: Stage: resolved
Components: Versions:
process
Status: closed Resolution: duplicate
Dependencies: Superseder: is_zipfile false positives
View: 28494
Assigned To: Nosy List: mxmlnkn
Priority: normal Keywords:

Created on 2021-09-25 14:20 by mxmlnkn, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
zips.rar mxmlnkn, 2021-09-25 14:20
Messages (1)
msg402624 - (view) Author: mxmlnkn (mxmlnkn) Date: 2021-09-25 14:20
I have created a RAR file containing two zip files like this:

zip bag.zip README.md CHANGELOG.md
zip bag1.zip CHANGELOG.md
rar a zips.rar bag.zip bag1.zip

And when calling `zipfile.is_zipfile` on zips.rar, it returns true even though it obviously is not a zip. The zips.rar file doesn't even begin with the magic bytes `PK` for zip but with `Rar!`.
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89450
2021-09-25 17:50:27serhiy.storchakasetstatus: open -> closed
resolution: duplicate
superseder: is_zipfile false positives
stage: resolved
2021-09-25 14:20:18mxmlnkncreate