Skip to content

Cannot import modules from Zip64 files #89739

Closed

Description

@luisffranca
BPO 45576
Nosy @luisffranca

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-10-22.16:40:33.579>
labels = ['type-bug', 'library', '3.9']
title = 'Cannot import modules from Zip64 files'
updated_at = <Date 2021-10-22.16:40:33.579>
user = 'https://github.com/luisffranca'

bugs.python.org fields:

activity = <Date 2021-10-22.16:40:33.579>
actor = 'lfamorim'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Library (Lib)']
creation = <Date 2021-10-22.16:40:33.579>
creator = 'lfamorim'
dependencies = []
files = []
hgrepos = []
issue_num = 45576
keywords = []
message_count = 1.0
messages = ['404792']
nosy_count = 1.0
nosy_names = ['lfamorim']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue45576'
versions = ['Python 3.9']

Linked PRs

Activity

  1. luisffranca commented on Oct 22, 2021

    luisffrancamannequin
    MannequinAuthor

    I've tried to import a module from a fat jar file and got a ModuleNotFoundError: No module named ... error.

    I checked that the jar file had more than 65k files and was created using Zip64. When I unzip the file, Python is capable of importing the modules.

    I was able to reproduce the error on a simple project, such as:

    simplePackage/
    __init__.py
    a/
    __init__.py
    moduleA.py

    where

    • I'm using Python 3.9.4
    • __init__.py files are empty
    • moduleA.py only has a printA() function

    I ran the following tests:

    1. When importing from the folder, it works
    python
    >>> import sys
    >>> sys.path.append('C:\\Users\\...\\simplePackage')
    >>> from a.moduleA import printA
    >>> printA()
    I'm module a
    1. When zipping the folder, it works
    python
    >>> import sys
    >>> sys.path.append('C:\\Users\\...\\simplePackage.zip')
    >>> from a.moduleA import printA
    >>> printA()
    I'm module a
    1. When forcing to zip with Zip64 it doesn't work

    On linux: zip -fzr simple64Package.zip .

    python
    >>> import sys
    >>> sys.path.append('C:\\Users\\...\\simple64Package.zip')
    >>> from a.moduleA import printA
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'a'

    Is this an expected behavior? Am I missing something?

    Thanks!

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    type-bugAn unexpected behavior, bug, or error
    on Oct 22, 2021
  3. transferred this issue fromon Apr 10, 2022
  4. added
    3.13only security fixes
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Sep 6, 2023
  5. added a commit that references this issue on Mar 4, 2024
  6. self-assigned this
    on Mar 28, 2024
  7. added a commit that references this issue on Mar 28, 2024
  8. added a commit that references this issue on Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

3.13only security fixesstdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions