[New-bugs-announce] [issue1060] zipfile cannot handle files larger than 2GB (inside archive)

Kevin Ar18 report at bugs.python.org
Wed Aug 29 23:34:55 CEST 2007


New submission from Kevin Ar18:

Summary:
If you have a zip file that contains a file inside of it greater than
2GB, then the zipfile module is unable to read that file.

Steps to Reproduce:
1. Create a zip file several GB in size with a file inside of it that is
over 2GB in size.
2. Attempt to read the large file inside the zip file.  Here's some
sample code:
import zipfile
import re

dataObj = zipfile.ZipFile("zip.zip","r")

for i in dataObj.namelist():
   if(i[-1] == "/"):
      print "dir"
   else:
      fileName = re.split(r".*/",i,0)[1]
      fileData = dataObj.read(i)


Result:
Python returns the following error:
File "...\zipfile.py", line 491, in read bytes =
self.fp.read(zinfo.compress_size) 
OverflowError: long it too large to convert to int

Expected Result:
It should copy the data into the variable fileData...

I'll try to post more info in a follow-up.

----------
components: Library (Lib)
messages: 55444
nosy: Kevin Ar18
severity: normal
status: open
title: zipfile cannot handle files larger than 2GB (inside archive)
type: compile error
versions: Python 2.6

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1060>
__________________________________


More information about the New-bugs-announce mailing list