[issue6839] zipfile can't extract file

2019-06-18 Thread Roundup Robot
Change by Roundup Robot : -- pull_requests: +14050 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/14212 ___ Python tracker ___ _

[issue6839] zipfile can't extract file

2019-06-18 Thread Morgan Ramsay
Morgan Ramsay added the comment: The encoding test in ZipFile.open() is highly opinionated and has no purpose beyond itself. Testing for encoding issues should be done outside this library in the user's own code. Using the 3.7.2 version of ZipFile, this is my proposal: https://gist.github.c

[issue6839] zipfile can't extract file

2015-07-21 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: -ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.p

[issue6839] zipfile can't extract file

2015-06-18 Thread Sean Goodwin
Changes by Sean Goodwin : -- nosy: +Sean Goodwin ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue6839] zipfile can't extract file

2014-05-05 Thread Adam Polkosnik
Adam Polkosnik added the comment: Both. Other programs, and in python scripts when raise() is removed in zipfile.py. Unless your results are different. -- ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-05-05 Thread Ethan Furman
Ethan Furman added the comment: Ah, so when you (Adam) said "extraction works fine", what you meant was "extraction works fine *in other programs*". Okay. -- ___ Python tracker

[issue6839] zipfile can't extract file

2014-05-02 Thread Adam Polkosnik
Adam Polkosnik added the comment: Ethan, I'd refer you to msg92309... And When testing with WinZip it looks like this: No errors detected in compressed data of C:\Downloads\test.zip. Testing ... Testing test\OK Testing test\test2.txt OK Testing test1.txt

[issue6839] zipfile can't extract file

2014-05-02 Thread Ethan Furman
Ethan Furman added the comment: Adam Polkasnik said: > Extraction works fine, the issue was that raise() was creating an exception, > and > stopping the whole extraction process. That doesn't make sense. If an exception was "stopping the whole extraction process" then ext

[issue6839] zipfile can't extract file

2014-05-02 Thread Adam Polkosnik
Adam Polkosnik added the comment: Extraction works fine, the issue was that raise() was creating an exception, and stoping the whole extraction process. When replaced with a warning, everything works fine. -- ___ Python tracker

[issue6839] zipfile can't extract file

2014-05-02 Thread Jim Jewett
Jim Jewett added the comment: On Fri, May 2, 2014 at 1:14 AM, Adam Polkosnik > The problems documented here are related to two cases (both apparently > arriving from world of windows): Good! I had thought you had even more! > 1. two relative paths with inverted slash in one of them (test\test

[issue6839] zipfile can't extract file

2014-05-01 Thread Adam Polkosnik
Adam Polkosnik added the comment: Jim, The problems documented here are related to two cases (both apparently arriving from world of windows): 1. two relative paths with inverted slash in one of them (test\test2.txt vs test/test2.txt) 2. relative path vs absolute path (windows\temp\test.txt v

[issue6839] zipfile can't extract file

2014-04-30 Thread Alan McIntyre
Changes by Alan McIntyre : -- nosy: -alanmcintyre ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue6839] zipfile can't extract file

2014-04-30 Thread Jim Jewett
Jim Jewett added the comment: On Wed, Apr 30, 2014 at 3:11 PM, Adam Polkosnik > I've got some test cases where the zlib_forward_slash.patch doesn't cut it. My recommendation (and I could be convinced otherwise) would be to replace if fname_str != zinfo.orig_filename: raise ... wit

[issue6839] zipfile can't extract file

2014-04-30 Thread Jim Jewett
Jim Jewett added the comment: On Wed, Apr 30, 2014 at 3:05 PM, Adam Polkosnik wrote: > test.zip up there is the test case for this change. Is there any other test > case needed? ah; I see the confusion. test.zip is test *data*. When I asked for a test *case*, I meant something that ensures t

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: Is there anything else that you need me to provide? -- ___ Python tracker ___ ___ Python-bugs-list ma

[issue6839] zipfile can't extract file

2014-04-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: The bug was that BadZipFile was being raised when it shouldn't be so I wouldn't worry about documenting the behavior change other than in the Misc/NEWS entry that the ultimate commiter writes up. -- ___ Python tra

[issue6839] zipfile can't extract file

2014-04-30 Thread Francisco Martín Brugué
Francisco Martín Brugué added the comment: A small question related to: "zipfile_276_filename_mismatch_v3.patch" --- a/zipfile.pyWed Apr 30 11:44:38 2014 +++ b/zipfile.pyWed Apr 30 15:10:38 2014 @@ -970,10 +970,10 @@ if fheader[_FH_EXTRA_FIELD_LENGTH]:

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: Jim, I've got some test cases where the zlib_forward_slash.patch doesn't cut it. That was the reason for trying a broader approach with filename_mismatch patches. -- Added file: http://bugs.python.org/file35120/zipfile_276_filename_mismatch_v3.patch

[issue6839] zipfile can't extract file

2014-04-30 Thread Ethan Furman
Ethan Furman added the comment: Adam, please stop deleting the files. It makes for a lot of noise to those on the nosy list, and is unnecessary. Just make sure you increment the version number on the files you upload and it will be fine. Thanks. -- _

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: I just looked through 2.7.6 version of zipfile, and the the error handling there is either through using raise() or print(). So, inline with the guidance provided for 2.7.6, perhapswe should stick with print() instead of warning.warn(). I'll post that a bit la

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35114/zipfile_340_filename_mismatch_v2.patch ___ Python tracker ___ ___ P

[issue6839] zipfile can't extract file

2014-04-30 Thread Jim Jewett
Jim Jewett added the comment: Presumably the stacklevel applies to all versions; verifying that it warns about the right code location is important enough to require a test case. -- ___ Python tracker _

[issue6839] zipfile can't extract file

2014-04-30 Thread Jim Jewett
Jim Jewett added the comment: I'm leaving it as "needs patch" because it isn't clear exactly what a committer should do. I think the current intent is to make the changes listed in zipfile_???_filename_mismatch_v2.patch (which are not listed as reviewable -- but the changes are indeed suffi

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: 3.4.0 pathc with stacklevel=2 -- Added file: http://bugs.python.org/file35117/zipfile_340_filename_mismatch_v3.patch ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-04-30 Thread Berker Peksag
Berker Peksag added the comment: --- a/zipfile.pyWed Apr 30 11:27:16 2014 +++ b/zipfile.pyWed Apr 30 11:27:01 2014 @@ -1174,8 +1174,9 @@ else: fname_str = fname.decode("cp437") -if fname_str != zinfo.orig_filename: -raise

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: Attached is a patch with warnings against 2.7.6 (this one should be good to go) -- Added file: http://bugs.python.org/file35115/zipfile_276_filename_mismatch_v2.patch ___ Python tracker

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35113/zipfile_276_filename_mismatch_v2.patch ___ Python tracker ___ ___ P

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: Attached is a patch with warnings against 3.4.0 -- Added file: http://bugs.python.org/file35114/zipfile_340_filename_mismatch_v2.patch ___ Python tracker __

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Adam Polkosnik added the comment: Attached is a patch with warnings against 2.7.6 -- Added file: http://bugs.python.org/file35113/zipfile_276_filename_mismatch_v2.patch ___ Python tracker __

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file33666/zipfile_stupid3.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35103/zipfile_340_filename_mismatch.patch ___ Python tracker ___ ___ Pyth

[issue6839] zipfile can't extract file

2014-04-30 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35104/zipfile_276_filename_mismatch.patch ___ Python tracker ___ ___ Pyth

[issue6839] zipfile can't extract file

2014-04-30 Thread Nick Coghlan
Nick Coghlan added the comment: As Greg suggested, the important thing is to follow the precedent set by other debug messages in the module. -- ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-04-30 Thread Gregory P. Smith
Gregory P. Smith added the comment: Don't use print (to stdout) or sys.stderr directly. There are already many other uses of warnings.warn within the zipfile module. Be consistent with those. Existing zipfile warnings seem to favor lazily importing warnings when its needed rather than a top

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Once again patch against 2.7.6 -- Added file: http://bugs.python.org/file35104/zipfile_276_filename_mismatch.patch ___ Python tracker ___ ___

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: update -- Added file: http://bugs.python.org/file35103/zipfile_340_filename_mismatch.patch ___ Python tracker ___ ___

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35101/zipfile_276_filename_mismatch.patch ___ Python tracker ___ ___ Pyth

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file35102/zipfile_340_filename_mismatch.patch ___ Python tracker ___ ___ Pyth

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Patch against zipfile 3.4.0 attached. -- Added file: http://bugs.python.org/file35102/zipfile_340_filename_mismatch.patch ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-04-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Nick, do you agree that this should be treated as a bug (apply to all 3 versions)? Should debug messages be 'print'ed, sent to stderr, or go through the warnings module? -- ___ Python tracker

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Patch against 2.7.6 attached. -- Added file: http://bugs.python.org/file35101/zipfile_276_filename_mismatch.patch ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-04-29 Thread Nick Coghlan
Nick Coghlan added the comment: The check can be simplified further to "if self.debug and fname != zinfo.orig_filename:", but the conversion to a debugging print seems reasonable to me. -- nosy: +ncoghlan ___ Python tracker

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: In any event, I think that zipfile_stupid3.patch would be the best trivial fix to this issue. -- ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Terry, I apologize about the second change of headers, somehow I must have used the submission form to post the comment from a tab that had the old content, and the headers didn't refresh there. I assure you that it was not my intention to change them again.

[issue6839] zipfile can't extract file

2014-04-29 Thread Ethan Furman
Changes by Ethan Furman : -- nosy: +ethan.furman ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.py

[issue6839] zipfile can't extract file

2014-04-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Adam P. I politely asked you to leave the headers alone. Since you ignored that, LEAVE THE HEADERS ALONE! If you continue, you will eventually get banned. An issue gets dealt with when a volunteer core developer makes it his top priority. In the past 24 hours

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: I've also tested with WinZip, and Windows Explorer, on windows. Both extract the contents of test.zip without a warning (just like 7zip on Windows did). This behavior counts as Denial Of Service if the zipfile Library is used to extract files, besides lots of

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: If I got a file scanner in my mail gateway implemented with this, one can easily avoid getting the contents of zip-files scanned. Is that enough of a security impact? -- ___ Python tracker

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Also, this behavior is present on all platforms and all versions of Python (zipfile Library), so maybe the headers should be adjusted there too. I'm not saying that this is necessarily a big freaking hole, but by using this, one can prevent files from being ex

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: For the version headers, I've added the versions featuring the broken behavior. That's all. I'm not saying that this is I'm extracting malware from the Central Quarantine files, and the vendor's implementation is broken and is causing this issue for me on ev

[issue6839] zipfile can't extract file

2014-04-29 Thread Terry J. Reedy
Terry J. Reedy added the comment: Adam P, please don't screw around with the version headers. If you want to claim that this is a security issue of the type we care about (threats to the public internet) for patching old releases, and severe enough that we should do anything about it, send a d

[issue6839] zipfile can't extract file

2014-04-29 Thread Adam Polkosnik
Adam Polkosnik added the comment: Gentlemen, Is there's any way this fix can be included in any version? Currently, the fact that the exception is thrown makes extracting some zip files impossible with this library, and rolling your own is a bit painful. (either using a wrapper around 7zip to

[issue6839] zipfile can't extract file

2014-02-18 Thread Adam Polkosnik
Adam Polkosnik added the comment: It might not be a regular "security" issue, but it is not extracting some files that it should. There's a possible scenario, where it can be a security issue. -- ___ Python tracker

[issue6839] zipfile can't extract file

2014-01-23 Thread Terry J. Reedy
Terry J. Reedy added the comment: Adam this is not a security issue (2.6, 3.1, 3.2), nor a future issue that must wait for 3.5. -- versions: -Python 2.6, Python 3.1, Python 3.2, Python 3.5 ___ Python tracker _

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file33662/zipfile_stupid.patch ___ Python tracker ___ ___ Python-bugs-list mai

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file33663/zipfile_stupid2.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Adam Polkosnik added the comment: Excellent, please see my third attempt. -- Added file: http://bugs.python.org/file33666/zipfile_stupid3.patch ___ Python tracker ___

[issue6839] zipfile can't extract file

2014-01-23 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > As I wrote in msg116385 I'd prefer to drop the consistency check completely > because updating data like the filename in the central directory is a cheap > way to rename files without completely rewriting the zip file. It should at least left as debugging pr

[issue6839] zipfile can't extract file

2014-01-23 Thread Georg Brandl
Georg Brandl added the comment: print() is not a good way to emit the warning; please use the warnings module. -- nosy: +georg.brandl ___ Python tracker ___ __

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Adam Polkosnik added the comment: Can we get this simple "fix" implemented in time for the next 2.7.x release?! Thank you! -- ___ Python tracker ___ _

[issue6839] zipfile can't extract file

2014-01-23 Thread Ronald Oussoren
Ronald Oussoren added the comment: As I wrote in msg116385 I'd prefer to drop the consistency check completely because updating data like the filename in the central directory is a cheap way to rename files without completely rewriting the zip file. --

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Adam Polkosnik added the comment: This one has the parentheses for print, so that it works in python 3.x. Also, the default fallback behavior in this case is to use the filename from the zips' directory (the first path in the warning). -- Added file: http://bugs.python.org/file33663/zi

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Adam Polkosnik added the comment: I'm in a similar situation, my test file raises this: File name in directory "windows\TEMP\\test123.txt" and header "C:\windows\TEMP\\test123.txt" differ. It turns out that I can't find any cross platform procedures for processing the paths between the differ

[issue6839] zipfile can't extract file

2014-01-23 Thread Adam Polkosnik
Changes by Adam Polkosnik : Removed file: http://bugs.python.org/file32160/zipfile.py.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue6839] zipfile can't extract file

2013-10-31 Thread Adam Polkosnik
Adam Polkosnik added the comment: Just tested my patch on mac, and it appears that it didn't work on OSX (and likely on other unix platforms too). Conclusion... os.path.basename() will not do anything to windows paths when running on unix. I'm thinking that instead of bailing at 'File name in

[issue6839] zipfile can't extract file

2013-10-24 Thread Tim Golden
Changes by Tim Golden : -- nosy: -tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue6839] zipfile can't extract file

2013-10-17 Thread Adam Polkosnik
Adam Polkosnik added the comment: I've got bitten by a different variation of this bug. In my case the issue can be summarized by: zipfile.BadZipfile: File name in directory "Windows\TEMP\test.tmp" and header "C:\Windows\TEMP\test.tmp" differ. Attached is a patch for Python27/lib/zipfile.py. I

[issue6839] zipfile can't extract file

2012-09-28 Thread Tim Golden
Changes by Tim Golden : -- assignee: tim.golden -> ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.

[issue6839] zipfile can't extract file

2012-04-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue6839] zipfile can't extract file

2010-09-14 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: I agree with the change, but the code should be factorized in a function (normalize_filename for example) -- nosy: +amaury.forgeotdarc ___ Python tracker ___

[issue6839] zipfile can't extract file

2010-09-14 Thread Ronald Oussoren
Ronald Oussoren added the comment: I'd prefer if the code no longer checked if the filename in the directory matches the name in the per-file header. The reason of that is that the two don't have to match: it is relatively cheap to rename a file in the zipfile by rewriting the directory while

[issue6839] zipfile can't extract file

2010-08-06 Thread Tim Golden
Changes by Tim Golden : -- assignee: -> tim.golden nosy: +tim.golden ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue6839] zipfile can't extract file

2009-09-19 Thread Jan Hosang
Jan Hosang added the comment: I added a patch to replace back slashes by forward slashes in three places, only one if them actually relevant to the errors in the attached .zip file. I kept the exception for mismatching filenames, but if you think it is appropriate to remove it I could do tha

[issue6839] zipfile can't extract file

2009-09-11 Thread Amaury Forgeot d'Arc
Changes by Amaury Forgeot d'Arc : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http

[issue6839] zipfile can't extract file

2009-09-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: In the case at issue, the file name is the same (contrary to the error message). The two representations of the *path* are different, but equivalent. There is no ambiguity: the file should be put in directory 'test' and named 'test2.txt'. So I think zipfile shou

[issue6839] zipfile can't extract file

2009-09-06 Thread Alan McIntyre
Alan McIntyre added the comment: Sorry about the confusion--I think I confused myself by looking at the bit about CRC checksums in the "Info-ZIP Unicode Path Extra Field" section before I posted. I meant to say that the central directory name looks preferred over the per-file header. n section

[issue6839] zipfile can't extract file

2009-09-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: alan: I don't quite understand which filename you want to use when the name in the per-file header and the central directory don't match. Where in the standard is this prescribed? I couldn't find anything in the PKWare zipfile appnote [1] My preference wou

[issue6839] zipfile can't extract file

2009-09-06 Thread Alan McIntyre
Alan McIntyre added the comment: FileRoller doesn't complain about the mismatched slashes either. Where did the ZIP come from, by the way? I seem to recall that there have been other instances in which ZIP applications were more "forgiving" than the zipfile module. How far should zipfile go i

[issue6839] zipfile can't extract file

2009-09-06 Thread Ronald Oussoren
Ronald Oussoren added the comment: The zipfile is technically incorrect, the zipfile specification prescribes that all filenames use '/' as the directory separator. Even without that caveat the file is corrupt because the zipfile directory header and the per-file header don't agree on the nam

[issue6839] zipfile can't extract file

2009-09-05 Thread Kim Kyung Don
Kim Kyung Don added the comment: P.S I tested extraction by using 7-zip. It works fine. -- ___ Python tracker ___ ___ Python-bugs-list

[issue6839] zipfile can't extract file

2009-09-04 Thread Kim Kyung Don
New submission from Kim Kyung Don : The following exception occured when I tried to extract on Windows. "zipfile.BadZipfile: File name in directory "test\test2.txt" and header "test/test2.txt" differ." It seems like problem about slash. I tested using by zipfile Revision 72893. -- ___

[issue6839] zipfile can't extract file

2009-09-04 Thread Kim Kyung Don
Changes by Kim Kyung Don : -- components: Library (Lib), Windows files: test.zip nosy: NewerCookie severity: normal status: open title: zipfile can't extract file type: behavior versions: Python 2.6 Added file: http://bugs.python.org/file14832/test.zip __