Hi,
I'm having a problem using the zipfile module in Windows 2000 sp4. When I
use it to zip a small file it works fine, but large file doesnt. Here's the
error msg i get...
---------------------------------------------------------------------
dynamite4_db_ar chive.py", line 45, in ?
file.write(name , os.path.basenam e(name), zipfile.ZIP_DEF LATED)
File "C:\Python22\li b\zipfile.py", line 426, in write
zinfo.file_size ))
OverflowError: long int too large to convert to int
---------------------------------------------------------------------
I've read a couple of problems with this module with long int, and it says
it's a know problem in Python earlier than 2.3
So I upgraded to 2.3 and i'm still getting the error msg. I'm not proficient
at python so I'm not sure what to do at this point. The file I'm currently
trying to zip is about 2.5GB.
Here's my code that's causing the error...
----------------------------------------------------------------------
currentDirFiles = os.listdir(mydi r) #list log file in dir
os.mkdir(todays _dir)
for item in currentDirFiles : #find the file with the date from 7 days ago
file_to_zip = mydir + item
destination = todays_dir + str('/') + item + str('_') + todays_date +
str('.zip')
print "\n" + file_to_zip + "\n" + destination
file = zipfile.ZipFile (destination, "w")
for name in glob.glob(file_ to_zip):
file.write(name , os.path.basenam e(name), zipfile.ZIP_DEF LATED)
file.close()
---------------------------------------------------------------------
Any help would be appreciated. TIA
LC
I'm having a problem using the zipfile module in Windows 2000 sp4. When I
use it to zip a small file it works fine, but large file doesnt. Here's the
error msg i get...
---------------------------------------------------------------------
dynamite4_db_ar chive.py", line 45, in ?
file.write(name , os.path.basenam e(name), zipfile.ZIP_DEF LATED)
File "C:\Python22\li b\zipfile.py", line 426, in write
zinfo.file_size ))
OverflowError: long int too large to convert to int
---------------------------------------------------------------------
I've read a couple of problems with this module with long int, and it says
it's a know problem in Python earlier than 2.3
So I upgraded to 2.3 and i'm still getting the error msg. I'm not proficient
at python so I'm not sure what to do at this point. The file I'm currently
trying to zip is about 2.5GB.
Here's my code that's causing the error...
----------------------------------------------------------------------
currentDirFiles = os.listdir(mydi r) #list log file in dir
os.mkdir(todays _dir)
for item in currentDirFiles : #find the file with the date from 7 days ago
file_to_zip = mydir + item
destination = todays_dir + str('/') + item + str('_') + todays_date +
str('.zip')
print "\n" + file_to_zip + "\n" + destination
file = zipfile.ZipFile (destination, "w")
for name in glob.glob(file_ to_zip):
file.write(name , os.path.basenam e(name), zipfile.ZIP_DEF LATED)
file.close()
---------------------------------------------------------------------
Any help would be appreciated. TIA
LC
Comment