[server] portable dump format supports now ZIP64 extensions by default (closes #1912535) stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Tue, 13 Sep 2011 17:42:22 +0200
branchstable
changeset 7787 d9607ae447d2
parent 7786 18a366267612
child 7788 cc8670be7b2e
[server] portable dump format supports now ZIP64 extensions by default (closes #1912535) ZIP files can use the ZIP64 extensions when the zipfile is larger than 2 GB. zipfile will raise an exception when the ZIP file would require ZIP64 extensions. Note: ZIP64 extensions are disabled by default in stdlib because the default zip and unzip commands on Unix (the InfoZIP utilities) don’t support these extensions.
server/sources/native.py
--- a/server/sources/native.py	Tue Sep 13 17:35:14 2011 +0200
+++ b/server/sources/native.py	Tue Sep 13 17:42:22 2011 +0200
@@ -1651,7 +1651,7 @@
         return self._source.get_connection()
 
     def backup(self, backupfile):
-        archive=zipfile.ZipFile(backupfile, 'w')
+        archive=zipfile.ZipFile(backupfile, 'w', allowZip64=True)
         self.cnx = self.get_connection()
         try:
             self.cursor = self.cnx.cursor()
@@ -1747,7 +1747,7 @@
         return dumps((name, columns, rows), pickle.HIGHEST_PROTOCOL)
 
     def restore(self, backupfile):
-        archive = zipfile.ZipFile(backupfile, 'r')
+        archive = zipfile.ZipFile(backupfile, 'r', allowZip64=True)
         self.cnx = self.get_connection()
         self.cursor = self.cnx.cursor()
         sequences, tables, table_chunks = self.read_metadata(archive, backupfile)