evhub / evhub/coconut

Coconut is incompatible with the zipapp module

Open
#720 2 comments 0 reactions 0 assignees View on GitHub
oversight
Dominant language
Python
Stars
4.4k
Forks
142
PR merge metrics
No merged PRs in 30d

Description

Part of coconut's current header contains a check for a `__init__.py` file in the executed python file's directory. That check uses `os.listdir` which cannot operate within a [zippapp](https://docs.python.org/3/library/zipapp.html). It is a known issue for zippapps to not be able to read files and directories like you could if you simply execute a python script, or a directory (using `__main__.py`). Tools like https://github.com/linkedin/shiv seem to circumvent this by extracting the zipapp before execution.

I'm not sure this is easily fixable, but since I just racked my brain for an hour wondering why this suddenly stopped working compared to older coconut versions, maybe a warning could be added to the docs or faq? :)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.