Skip to content

Commit 2aa3fe7

Browse files
Force zip64 when allowZip64 is enabled (#1532)
1 parent d969b96 commit 2aa3fe7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fsspec/implementations/zip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ def __init__(
5656
fo = fsspec.open(
5757
fo, mode=m, protocol=target_protocol, **(target_options or {})
5858
)
59+
self.force_zip_64 = allowZip64
5960
self.of = fo
6061
self.fo = fo.__enter__() # the whole instance is a context
6162
self.zip = zipfile.ZipFile(
@@ -125,7 +126,7 @@ def _open(
125126
raise FileNotFoundError(path)
126127
if "r" in self.mode and "w" in mode:
127128
raise OSError("ZipFS can only be open for reading or writing, not both")
128-
out = self.zip.open(path, mode.strip("b"))
129+
out = self.zip.open(path, mode.strip("b"), force_zip64=self.force_zip_64)
129130
if "r" in mode:
130131
info = self.info(path)
131132
out.size = info["size"]

0 commit comments

Comments
 (0)