Skip to content
This repository has been archived by the owner on Oct 30, 2022. It is now read-only.

Commit

Permalink
🐛 - Allow ZIP64
Browse files Browse the repository at this point in the history
Address #102
  • Loading branch information
drinfernoo committed May 30, 2020
1 parent a6a5d61 commit 7596bc5
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 17 deletions.
20 changes: 10 additions & 10 deletions resources/libs/backup.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,11 +136,11 @@ def backup_addon_pack(self, name=""):
tempzipname = ''
zipname = os.path.join(CONFIG.MYBUILDS, name)
try:
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w')
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w', allowZip64=True)
except:
try:
tempzipname = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(name))
zipf = zipfile.ZipFile(tempzipname, mode='w')
zipf = zipfile.ZipFile(tempzipname, mode='w', allowZip64=True)
except:
logging.log("Unable to create {0}.zip".format(name), level=xbmc.LOGERROR)
if self.dialog.yesno(CONFIG.ADDONTITLE,
Expand Down Expand Up @@ -255,11 +255,11 @@ def backup_build(self, name=""):
tools.convert_special(CONFIG.HOME, True)
extractsize = 0
try:
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w')
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w', allowZip64=True)
except:
try:
tempzipname = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(name))
zipf = zipfile.ZipFile(tempzipname, mode='w')
zipf = zipfile.ZipFile(tempzipname, mode='w', allowZip64=True)
except:
logging.log("Unable to create {0}.zip".format(name), level=xbmc.LOGERROR)
if self.dialog.yesno(CONFIG.ADDONTITLE,
Expand Down Expand Up @@ -515,11 +515,11 @@ def backup_gui(self, name=""):
guizipname = os.path.join(CONFIG.MYBUILDS, '{0}_guisettings.zip'.format(guiname))
if os.path.exists(CONFIG.GUISETTINGS):
try:
zipf = zipfile.ZipFile(guizipname, mode='w')
zipf = zipfile.ZipFile(guizipname, mode='w', allowZip64=True)
except:
try:
tempguizipname = os.path.join(CONFIG.PACKAGES, '{0}_guisettings.zip'.format(guiname))
zipf = zipfile.ZipFile(tempguizipname, mode='w')
zipf = zipfile.ZipFile(tempguizipname, mode='w', allowZip64=True)
except:
logging.log("Unable to create {0}_guisettings.zip".format(guiname), level=xbmc.LOGERROR)
if self.dialog.yesno(CONFIG.ADDONTITLE,
Expand Down Expand Up @@ -593,11 +593,11 @@ def backup_theme(self, name=""):
tempzipname = ''
zipname = os.path.join(CONFIG.MYBUILDS, '{0}.zip'.format(themename))
try:
zipf = zipfile.ZipFile(zipname, mode='w')
zipf = zipfile.ZipFile(zipname, mode='w', allowZip64=True)
except:
try:
tempzipname = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(themename))
zipf = zipfile.ZipFile(tempzipname, mode='w')
zipf = zipfile.ZipFile(tempzipname, mode='w', allowZip64=True)
except:
logging.log("Unable to create {0}.zip".format(themename), level=xbmc.LOGERROR)
if self.dialog.yesno(CONFIG.ADDONTITLE,
Expand Down Expand Up @@ -801,11 +801,11 @@ def backup_addon_data(self, name=""):
tempzipname = ''
zipname = os.path.join(CONFIG.MYBUILDS, name)
try:
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w')
zipf = zipfile.ZipFile(xbmc.translatePath(zipname), mode='w', allowZip64=True)
except:
try:
tempzipname = os.path.join(CONFIG.PACKAGES, '{0}.zip'.format(name))
zipf = zipfile.ZipFile(tempzipname, mode='w')
zipf = zipfile.ZipFile(tempzipname, mode='w', allowZip64=True)
except:
logging.log("Unable to create {0}_addondata.zip".format(name), level=xbmc.LOGERROR)
if self.dialog.yesno(CONFIG.ADDONTITLE,
Expand Down
2 changes: 1 addition & 1 deletion resources/libs/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -452,7 +452,7 @@ def fix_update():


def grab_addons(path):
zfile = zipfile.ZipFile(path)
zfile = zipfile.ZipFile(path, allowZip64=True)
addonlist = []
for item in zfile.infolist():
if str(item.filename).find('addon.xml') == -1:
Expand Down
2 changes: 1 addition & 1 deletion resources/libs/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def all_with_progress(_in, _out, dp, ignore, title):
excludes = []

try:
zin = zipfile.ZipFile(_in, 'r')
zin = zipfile.ZipFile(_in, 'r', allowZip64=True)
except Exception as e:
errors += 1
error += '%s\n' % e
Expand Down
4 changes: 2 additions & 2 deletions resources/libs/restore.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def _from_file(self, file, loc):

if not self.external:
try:
zipfile.ZipFile(file, 'r')
zipfile.ZipFile(file, 'r', allowZip64=True)
except zipfile.BadZipFile as e:
from resources.libs.common import logging
logging.log(e, level=xbmc.LOGERROR)
Expand All @@ -121,7 +121,7 @@ def _from_file(self, file, loc):
xbmcvfs.copy(file, packages)
file = xbmc.translatePath(packages)
self.progress_dialog.update(0, '', 'Copying file to packages: Complete')
zipfile.ZipFile(file, 'r')
zipfile.ZipFile(file, 'r', allowZip64=True)
else:
from resources.libs.downloader import Downloader
Downloader().download(file, packages)
Expand Down
2 changes: 1 addition & 1 deletion resources/libs/save.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def export_save_data():
source = xbmc.translatePath(source)
tempzip = os.path.join(source, 'SaveData.zip')
superfold = os.path.join(CONFIG.ADDON_DATA, 'plugin.program.super.favourites')
zipf = zipfile.ZipFile(tempzip, mode='w')
zipf = zipfile.ZipFile(tempzip, mode='w', allowZip64=True)
for fold in dir:
path = os.path.join(CONFIG.PLUGIN_DATA, fold)
if os.path.exists(path):
Expand Down
4 changes: 2 additions & 2 deletions resources/libs/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def str_test(teststr):
def test_theme(path):
from resources.libs.common import logging

zfile = zipfile.ZipFile(path)
zfile = zipfile.ZipFile(path, allowZip64=True)
for item in zfile.infolist():
logging.log(str(item.filename))
if '/settings.xml' in item.filename:
Expand All @@ -47,7 +47,7 @@ def test_theme(path):


def test_gui(path):
zfile = zipfile.ZipFile(path)
zfile = zipfile.ZipFile(path, allowZip64=True)
for item in zfile.infolist():
if '/guisettings.xml' in item.filename:
return True
Expand Down

0 comments on commit 7596bc5

Please sign in to comment.