GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Python cannot run Subpars larger than 2GiB because they are Zip64 formatted. · Issue #132 · google/subpar

This repository was archived by the owner on Jan 8, 2024. It is now read-only.
This repository was archived by the owner on Jan 8, 2024. It is now read-only.

Python cannot run Subpars larger than 2GiB because they are Zip64 formatted. #132

Copy link
Copy link
Open
Open
Python cannot run Subpars larger than 2GiB because they are Zip64 formatted.#132
Copy link

Description

@thundergolfer
thundergolfer
opened on Jun 9, 2021
Issue body actions

This is very unlikely to be fixed due to Subpar's maintenance status but it's good to document it here to potentially save others some debugging time.


Any .par written by Subpar using zipfile will be ZIP64 format whenever the file size exceeds ZIP64_LIMIT = (1 << 31) - 1. See https://github.com/python/cpython/blob/ffd87b7093109c279caf8e3ca060f408a102388a/Lib/zipfile.py#L56

As of Python 3.10 zipimport does not support ZIP64. The module function in question is _read_directory: https://github.com/python/cpython/blob/bb3e0c240bc60fe08d332ff5955d54197f79751c/Lib/zipimport.py#L408-L468

On attempting to run the subpar like python3 foo.par you will get an obscure error:

can't find '__main__' module in /foo.par

If you do python3 -vv foo.par you will see a logline:

# zipimport: found 0 names in /abs/path/to/foo.par

Python's zipimport._read_directory has failed to find any files because it has incorrectly calculated the byte offset for the first ZIP record file. It has incorrectly calculated the byte offset because it does not understand ZIP64.


So if you see this error check the size of your .par.

par_size = ...
max_bytes = (1 << 31) -1
if max_bytes < par_size:
    print("bad news")

cc @ducthienbui97 who completed this bug investigation.

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

      You are visitor 01402520 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.