Coconut is incompatible with the zipapp module
- 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
Assessment
This issue has not been assessed yet.