[issue10694] zipfile.py end of central directory detection not robust

2018-09-25 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This change significantly increased the probability of false positive detection in is_zipfile(). It was around 1/2**32, now it is around 1/2**16. It looks small, but not enough small if you test hundreds of thousands files. See issue28494. --

[issue10694] zipfile.py end of central directory detection not robust

2011-06-09 Thread Roundup Robot
Roundup Robot devnull@devnull added the comment: New changeset 7530b141c20f by R David Murray in branch '3.2': #10694: zipfile now ignores garbage at the end of a zipfile. http://hg.python.org/cpython/rev/7530b141c20f New changeset 2e49722c7263 by R David Murray in branch 'default': Merge

[issue10694] zipfile.py end of central directory detection not robust

2011-06-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: While I don't understand the zip file structure enough to do a definitive review of the patch, I'm willing to take processing 50K zip files successfully as a definitive test :) -- resolution: - fixed stage: patch review -

[issue10694] zipfile.py end of central directory detection not robust

2011-06-05 Thread Amar Takhar
Amar Takhar v...@aegisub.org added the comment: This patch fixed every BadZipfile exception (~300) I got while testing over 50,000 zipfiles. (Applied to 2.7) It would be nice to see this bug resolved. -- nosy: +verm ___ Python tracker

[issue10694] zipfile.py end of central directory detection not robust

2011-03-22 Thread bcroq
Changes by bcroq bertrand.c...@gmail.com: -- nosy: +bcroq ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___ Python-bugs-list mailing

[issue10694] zipfile.py end of central directory detection not robust

2011-03-22 Thread Bertrand Croq
Bertrand Croq bertrand.c...@gmail.com added the comment: The last patch (manually applied to Python 2.6) fixed the problem with a ZIP file used in my project. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694

[issue10694] zipfile.py end of central directory detection not robust

2011-03-22 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- nosy: +amaury.forgeotdarc versions: +Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___

[issue10694] zipfile.py end of central directory detection not robust

2011-03-21 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: Hi, can someone look at the patch? There doesn't seem to be any objections to it and it'll solve a long-standing issue. Thanks! -- ___ Python tracker rep...@bugs.python.org

[issue10694] zipfile.py end of central directory detection not robust

2011-03-21 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___

[issue10694] zipfile.py end of central directory detection not robust

2011-02-10 Thread rep
rep m...@mwcollect.org added the comment: Xuanji: Patch looks good now with the test cases. Regarding the other fix suggested by Kevin I think that we should not introduce custom behaviour here like appending the eofdata to the comment even though the comment size in the record does not say

[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: I've attached a patch copying rep's patch from issue 10298, as i think it is cleaner (but it seems to do the same thing as kevin's patch) together with 2 test cases. David Murray: I'm not really sure what you mean by test comments with trailing

[issue10694] zipfile.py end of central directory detection not robust

2011-02-09 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Xuanji: yes, your test_ignores_stuff_appended_past_comments is exactly what I was asking for. I've put this patch on my review list, but I may not get to it until after 3.2 final. -- ___

[issue10694] zipfile.py end of central directory detection not robust

2011-01-15 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: Not important enough to block release. -- priority: deferred blocker - critical ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___

[issue10694] zipfile.py end of central directory detection not robust

2011-01-14 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- stage: unit test needed - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694 ___ ___

[issue10694] zipfile.py end of central directory detection not robust

2010-12-31 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: I finally got around to researching this issue in the tracker. Issue 10298 is a close relative to this issue. The fix from that issue make the test that Xuanji added here pass. That issue contains no testsit would be ideal to have

[issue10694] zipfile.py end of central directory detection not robust

2010-12-30 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: Ok, new patch that creates a zipfile (actually I used TESTFN2, all the other tests seem to also use it) -- Added file: http://bugs.python.org/file20200/Issue10694_2.diff ___ Python tracker

[issue10694] zipfile.py end of central directory detection not robust

2010-12-21 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: Hi KevinH, sorry if I gave the wrong impression that you must submit a patch before anyone will look at the bug. I thought you wanted to provide a patch for this. If you only want to report a bug that is ok, thanks for that. I have confirmed your

[issue10694] zipfile.py end of central directory detection not robust

2010-12-21 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: Sorry, forgot to add: README.zip should have a \r\n at the end. Actually I just zipped up README, ran echo \r\n README.zip and put it in Lib/test. -- ___ Python tracker rep...@bugs.python.org

[issue10694] zipfile.py end of central directory detection not robust

2010-12-21 Thread Georg Brandl
Georg Brandl ge...@python.org added the comment: High is not near high enough to get noticed before the release :) -- nosy: +georg.brandl priority: high - deferred blocker ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694

[issue10694] zipfile.py end of central directory detection not robust

2010-12-21 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Xuanji: thanks for taking a crack at the test. Rather than adding another data file to the test directory, how about creating a zipfile using the zipfile module in the test, closing it, opening it as a file, writing the /r/n to it, and

[issue10694] zipfile.py end of central directory detection not robust

2010-12-20 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: I have not looked at how other tools handle this. They could simply ignore what comes after a valid endrecdata is found, they could strip it out (truncate it) or make it into a final comment. I guess for simply unpacking a zip

[issue10694] zipfile.py end of central directory detection not robust

2010-12-20 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: It's pretty easy, really, to do an SVN checkout of python and compile it on a mac, if you are at all familiar with the unix command line. If you don't have the time or desire for that, though, someone will eventually get to it, we just

[issue10694] zipfile.py end of central directory detection not robust

2010-12-20 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: Been programming on unix/vax and then linux since the mid 80s and on punch cards in the late 70s. Grew my first beard writing 8080 and Z80 assembler. All of that was over 30 years ago. All I want to do is report a damn bug!

[issue10694] zipfile.py end of central directory detection not robust

2010-12-20 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Sorry, I thought I was being clear that if you *wanted* to help further here was how you could, but if you didn't then we'd get to it eventually. We're all volunteers here, just like you, so every bit of help...helps, and we thank you

[issue10694] zipfile.py end of central directory detection not robust

2010-12-19 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Thanks for the suggested code. As suggested, it would be helpful to supply a complete patch (or patches) ready to be reviewed and applied to the tips of the currently maintained source trees (py3k, 3.1, and 2.7) including adding an appropriate test

[issue10694] zipfile.py end of central directory detection not robust

2010-12-19 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: Final patches against the trees make no sense as no developer has decided which way they want to actually handle the problem. My patch is only one way and I note it may not be the way the owners of the code want. Also, this

[issue10694] zipfile.py end of central directory detection not robust

2010-12-19 Thread Ned Deily
Ned Deily n...@acm.org added the comment: Not to belabor the point but the most useful part of a ready-to-go patch would be to have a fully automated test case that fits into the existing test_zipfile.py structure and that demonstrates the failure. Somebody has to write a test case one way or

[issue10694] zipfile.py end of central directory detection not robust

2010-12-19 Thread R. David Murray
R. David Murray rdmur...@bitdance.com added the comment: Actually our normal procedure currently (this will change a bit after the migration to mercurial) is a patch against the py3k branch, and the committer will do the backport to the other active branches. If the 2.7 code is very

[issue10694] zipfile.py end of central directory detection not robust

2010-12-18 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: Same problem exists in Python 3.1.3 and in later versions as well. Same patch should also work. -- versions: +Python 3.1, Python 3.2 ___ Python tracker rep...@bugs.python.org

[issue10694] zipfile.py end of central directory detection not robust

2010-12-14 Thread Xuanji Li
Xuanji Li xua...@gmail.com added the comment: Hi, I would like to take a look at whether your code works, can you provide an zip file that is currently not read by zipfile but should be? Also, I suggest you submit the code changes as a patch (http://www.python.org/dev/patches/) thanks!

[issue10694] zipfile.py end of central directory detection not robust

2010-12-14 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: If you read the bug report it explains how to generate a testcase (i.e. append any data to the end of a zip archive) Here it is as a step by step process 1. simply take any working zip and call it testcase.zip 2. do the

[issue10694] zipfile.py end of central directory detection not robust

2010-12-14 Thread Kevin Hendricks
Kevin Hendricks kevin.hendri...@sympatico.ca added the comment: Here is one potential patch. It simply incorporates and non-comment extraneous data into a final comment so that nothing is lost. Another solution that might be safer, would be to truncate the zip archive immediately after the

[issue10694] zipfile.py end of central directory detection not robust

2010-12-14 Thread Kevin Hendricks
Changes by Kevin Hendricks kevin.hendri...@sympatico.ca: -- keywords: +patch versions: +Python 2.5, Python 2.6 Added file: http://bugs.python.org/file20040/more_robust.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10694

[issue10694] zipfile.py end of central directory detection not robust

2010-12-13 Thread Kevin Hendricks
New submission from Kevin Hendricks kevin.hendri...@sympatico.ca: The current version of zipfile.py is not robust to slight errors at the end of zip archives. Many file servers **improperly** append a new line to the end of files that do not have a new line when they are uploaded from a