linkedin / linkedin/shiv

unable to run shiv module after manual unzip

Open
#259 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
1.9k
Forks
114
PR merge metrics
No merged PRs in 30d

Description

i build a zip file with shiv named 'hello.zip', but it is too large (2.2GB) that the original method 'python hello.zip' report error: no module name __main__, i find associated issues and understand it is a python bug. then i want to unzip this zip myself and i get files like
--_bootstrap
--site-packages
--__main__.py
--environment.json
when i run python __main__.py, its reports error:
Traceback (most recent call last):
File "D:\env\test_code\hello-world\hellonew\__main__.py", line 3, in
_bootstrap.bootstrap()
File "D:\env\test_code\hello-world\hellonew\_bootstrap\__init__.py", line 196, in bootstrap
env = Environment.from_json(archive.read("environment.json").decode())
AttributeError: 'NoneType' object has no attribute 'read'
any suggestions? i use win10 with python3.10.11 as the runtime env.

Contributor guide

Open the contributing guide

Research direction

Reproduce the Windows 10/Python 3.10.11 case using the generated hello.zip, then inspect __main__.py and _bootstrap/__init__.py, especially the Environment.from_json call involving environment.json. Compare execution from the archive with execution after manual extraction; done means the supported behavior is established and the failure is fixed or clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.