[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-28 Thread miss-islington


miss-islington  added the comment:


New changeset 0eb69990c85b6c82c677d5a43e3df28836ae845e by Miss Islington (bot) 
in branch '3.7':
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
https://github.com/python/cpython/commit/0eb69990c85b6c82c677d5a43e3df28836ae845e


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

@Guillaume.Carre, thank you for the report and @fran6co, thank you for the 
contribution.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-28 Thread Cheryl Sabella


Cheryl Sabella  added the comment:


New changeset ab0716ed1ea2957396054730afbb80c1825f9786 by Cheryl Sabella 
(Francisco Facioni) in branch 'master':
bpo-22102: Fixes zip files with disks set to 0 (GH-5985)
https://github.com/python/cpython/commit/ab0716ed1ea2957396054730afbb80c1825f9786


--
nosy: +cheryl.sabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-28 Thread miss-islington


Change by miss-islington :


--
pull_requests: +13536
pull_request: https://github.com/python/cpython/pull/13641

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-13 Thread A.M. Kuchling


A.M. Kuchling  added the comment:

Oh, I missed that there was already a patch. BTW, I found two dissections of 
zip files that also show disk numbers of 0: the one at 
https://rzymek.github.io/post/excel-zip64/ is exploring an Excel Zip issue, and 
the forensic tutorial at 
https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html is discussing 
the format.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-05-13 Thread A.M. Kuchling


A.M. Kuchling  added the comment:

I also ran across this issue today, where the 'disks' value in a Zip file is 0. 
I'm trying to find out what software was used to create them, but it's quite 
plausible that it's Windows as Ramsey Kant suggests. So I think this fix should 
get applied to 3.8 and 3.7. Would it help if I produced a patch?

The PKWare Zip specification that takluyver links above has been updated -- it 
now has an April 29th updated -- but none of the changes are relevant to this.

Interestingly, the 'ditto' command on MacOS X (which can also unpack zip files) 
doesn't complain about the disk number either. I was unable to figure out where 
the source code for ditto is; I couldn't find it on opensource.apple.com.

--
nosy: +akuchling

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-04-13 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +alanmcintyre, serhiy.storchaka, twouters
versions:  -Python 2.7, Python 3.5, Python 3.6, Python 3.7, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2019-04-13 Thread Ramsey Kant


Ramsey Kant  added the comment:

I would second this PR.  The Win32 API that creates ZIP64 files produces ZIP64 
files with the "diskno" as 0 and "disks" as 0 (instead of "1" as indicated by 
the spec).

--
nosy: +Ramsey Kant
versions: +Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Guillaume Carre

Guillaume Carre  added the comment:

Yes these were pretty large zip 30 to 60Gb with thousands of small files in
them I've fixed locally on our servers and we've been happy even after
accepting similar sized files from linux machine.
I'm also quite surprised about this not being reported by others.

On Mon, Mar 12, 2018 at 9:01 AM, Thomas Kluyver 
wrote:

>
> Thomas Kluyver  added the comment:
>
> If every Windows 7 computer is generating zipfiles which are invalid in
> this way, that would be a pretty strong argument for Python (and other
> tools) to accept it. But if that was the case, I would also expect that
> there would be many more issues about it.
>
> Are the files you're compressing large (multi-GB)? Python only uses the
> zip64 format when the files are too big for the older zip format; maybe
> Windows is doing the same. Even in that case, I'm still surprised that more
> people don't hit it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

If every Windows 7 computer is generating zipfiles which are invalid in this 
way, that would be a pretty strong argument for Python (and other tools) to 
accept it. But if that was the case, I would also expect that there would be 
many more issues about it.

Are the files you're compressing large (multi-GB)? Python only uses the zip64 
format when the files are too big for the older zip format; maybe Windows is 
doing the same. Even in that case, I'm still surprised that more people don't 
hit it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Guillaume Carre

Guillaume Carre  added the comment:

Hi,
In my case the zip file was created from windows 7  context menu (send to)
Regards,
Guillaume

On Mon, Mar 12, 2018 at 5:08 AM, Thomas Kluyver 
wrote:

>
> Thomas Kluyver  added the comment:
>
> I found source code for some other projects handling the same data. They
> all seem to agree that it should be 1:
>
> - Golang's zip reading code: https://github.com/golang/go/blob/
> f7ac70a56604033e2b1abc921d3f0f6afc85a7b3/src/archive/zip/
> reader.go#L536-L538
> - A C contrib file with zlib: https://github.com/madler/zlib/blob/
> cacf7f1d4e3d44d871b605da3b647f07d718623f/contrib/minizip/zip.c#L620-L624
> - Code from Info-ZIP, which is used by many Linux distros, is a bit less
> clear, but it has an illuminating comment:
>
> if ((G.ecrec.number_this_disk != 0x) &&
> (G.ecrec.number_this_disk != ecloc64_total_disks - 1)) {
>   /* Note: For some unknown reason, the developers at PKWARE decided to
>  store the "zip64 total disks" value as a counter starting from 1,
>  whereas all other "split/span volume" related fields use 0-based
>  volume numbers. Sigh... */
>
> So I think you've got an invalid zip file. If it's otherwise valid, there
> might be a case for Python tolerating that particular mistake. But it's
> probably better to fix whatever is making the incorrect zip file, because
> other tools are also going to reject it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

I found source code for some other projects handling the same data. They all 
seem to agree that it should be 1:

- Golang's zip reading code: 
https://github.com/golang/go/blob/f7ac70a56604033e2b1abc921d3f0f6afc85a7b3/src/archive/zip/reader.go#L536-L538
- A C contrib file with zlib: 
https://github.com/madler/zlib/blob/cacf7f1d4e3d44d871b605da3b647f07d718623f/contrib/minizip/zip.c#L620-L624
- Code from Info-ZIP, which is used by many Linux distros, is a bit less clear, 
but it has an illuminating comment:

if ((G.ecrec.number_this_disk != 0x) &&
(G.ecrec.number_this_disk != ecloc64_total_disks - 1)) {
  /* Note: For some unknown reason, the developers at PKWARE decided to
 store the "zip64 total disks" value as a counter starting from 1,
 whereas all other "split/span volume" related fields use 0-based
 volume numbers. Sigh... */

So I think you've got an invalid zip file. If it's otherwise valid, there might 
be a case for Python tolerating that particular mistake. But it's probably 
better to fix whatever is making the incorrect zip file, because other tools 
are also going to reject it.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-12 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

Do you know what tool created the zip file? I can't find anything in the spec 
(https://pkware.cachefly.net/webdocs/casestudies/APPNOTE.TXT ) to say whether 0 
is a valid value for the number of disks.

--
nosy: +takluyver

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2018-03-05 Thread Francisco Facioni

Change by Francisco Facioni :


--
keywords: +patch
pull_requests: +5752
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22102] Zipfile generates Zipfile error in zip with 0 total number of disk in Zip64 end of central directory locator

2014-07-29 Thread Guillaume Carre

New submission from Guillaume Carre:

I've got a zip file with a Zip64 end of central directory locator in which:
- total number of disks = 
- number of the disk with the start of the zip64 end of central directory = 

According to the test line 176 in zipfile.py this fails:
if diskno != 0 or disks != 1:
raise BadZipfile(zipfiles that span multiple disks are not supported)

I believe the test should be changed to  
if diskno != 0 or disks  1:

--
components: Library (Lib)
messages: 224257
nosy: Guillaume.Carre
priority: normal
severity: normal
status: open
title: Zipfile generates Zipfile error in zip with 0 total number of disk in 
Zip64 end of central directory locator
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22102
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com