Skip to content

cli/package.py: RuntimeError: File size too large, try using force_zip64 for files exceeding 2 GB #4

Description

@djbordelon

Hello,
when trying to run cfde-c2m2 package, I encountered this error:

Traceback (most recent call last):
...
  File "<PATH>/lib/python3.14/site-packages/click/core.py", line 824, in invoke
    return callback(*args, **kwargs)
  File "<PATH>/lib/python3.14/site-packages/cfde_c2m2/cli/package.py", line 19, in package
    with zf.open(path, 'w') as fw:
         ~~~~~~~^^^^^^^^^^^
  File "<PATH>/conda/envs/cfde/lib/python3.14/zipfile/__init__.py", line 1355, in close
    raise RuntimeError("File size too large, try using force_zip64")
RuntimeError: File size too large, try using force_zip64

It turns out that our file.tsv is ~5.0 GB, and that this is a limitation of the default parameters in zipfile.ZipFile().open(). My fix was to simply change line 19 of cli/package.py to add force_zip64=True, and it worked. I did not want to submit as a forked PR however, as you may want to add some kind of check on file sizes, so that the parameter is only called if needed.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions