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

In general, ScriptMaker does not validate the Python executable is a shell script or not. #144

Open
vsajip opened this issue Apr 28, 2021 · 0 comments
Labels
bug Something isn't working trivial

Comments

@vsajip
Copy link
Collaborator

vsajip commented Apr 28, 2021

Original report by 林玮 (Jade Lin) (Bitbucket: 林玮 (Jade Lin), ).


The executable path that ScriptMaker got may be a script. For example, the Python executable installed from nix is a bash script like this.

#! /nix/store/ra8yvijdfjcs5f66b99gdjn86gparrbz-bash-4.4-p23/bin/bash -e
export NIX_PYTHONPREFIX='/nix/store/i46k148mi830riq4wxh49ki8qmq0731k-python3-3.9.2-env'
export NIX_PYTHONEXECUTABLE='/nix/store/i46k148mi830riq4wxh49ki8qmq0731k-python3-3.9.2-env/bin/python3.9'
export NIX_PYTHONPATH='/nix/store/i46k148mi830riq4wxh49ki8qmq0731k-python3-3.9.2-env/lib/python3.9/site-packages'
export PYTHONNOUSERSITE='true'
exec "/nix/store/7pjbbmnrch7frgyp7gz19ay0z1173c7y-python3-3.9.2/bin/python3.9"  "$@"

ScriptMaker only validates it and adapts it while running on the Java platform. Maybe refactor to apply the adaption for general cases.

https://bitbucket.org/pypa/distlib/src/4f54a3117db58f6bb00c69ab9a892170b91acd3b/distlib/scripts.py#lines-102:125

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working trivial
Projects
None yet
Development

No branches or pull requests

1 participant