Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coconut is incompatible with the zipapp module #720

Open
yggdr opened this issue Feb 18, 2023 · 2 comments
Open

Coconut is incompatible with the zipapp module #720

yggdr opened this issue Feb 18, 2023 · 2 comments

Comments

@yggdr
Copy link

yggdr commented Feb 18, 2023

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. 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? :)

@evhub evhub added this to the v3.0.0 milestone Feb 19, 2023
@evhub
Copy link
Owner

evhub commented Feb 19, 2023

I think that you should be able to make this work if you compile everything with --stand-alone.

@yggdr
Copy link
Author

yggdr commented Feb 19, 2023

After a few quick tests, this indeed seems to be working, at the cost of tripling the resulting build's size. But I think can live with that for now :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants