[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: zipinfo detects /usr/bin/zip as a zip archive too. -- ___ Python tracker ___ ___ Python-bugs-list

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Bohuslav "Slavek" Kabrda
Bohuslav "Slavek" Kabrda added the comment: Tried is_zipfile on /usr/bin/zip and it returns True, too, so it seems that this is a more general problem for zip-handling binaries... Anyway, thank you both, I agree that there is not much that can be done here. --

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread R. David Murray
R. David Murray added the comment: Well, yes, but that ship has already sunk :) -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It's rather a bug in the ZIP format design. -- ___ Python tracker ___ ___ Python-bugs-list mailing

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread R. David Murray
R. David Murray added the comment: So, it looks like this is not a bug in Python, just a weirdness of fastjar. Or, if you prefer, a bug in fastjar (they could assemble the signature instead of coding it as a single constant). -- resolution: -> invalid stage: -> committed/rejected st

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: $ zipinfo fastjar Archive: fastjar Zip file size: 47664 bytes, number of entries: 31883 [fastjar]: Zipfile is disk 33807 of a multi-disk archive, and this is not the disk on which the central zipfile directory begins (disk 190). I.e. zipinfo de

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread R. David Murray
R. David Murray added the comment: I'm imagining that it creates jar files, and thus has the signature as a constant. The is_zipfile check is much more complicated than just looking for that string, though, so what is going on must be even more perverse than that. It would be interesting to

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Bohuslav "Slavek" Kabrda
Bohuslav "Slavek" Kabrda added the comment: Oh, sorry, I will upload it on the bugtracker next time. I know that jar files are zip files, but this is not a jar (although it has "jar" in file). This is a binary. -- ___ Python tracker

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: You can upload a sample file on bug tracker. Actually jar files are just zip files (with some limitation and special files). zipfile.is_zipfile should return True on a jar file. -- nosy: +serhiy.storchaka ___ Pyth

[issue16735] zipfile.is_zipfile wrongly recognizes non-zip as zip

2012-12-20 Thread Bohuslav "Slavek" Kabrda
New submission from Bohuslav "Slavek" Kabrda: When I use zipfile.is_zipfile on file fastjar (sample uploaded at [1]) from libgcj, I get True, while I should get False (reproducible with fastjar from libgcj 4.7.2 on Fedora 18). This is caused by stringEndArchive string being present in the file,