pypa / pypa/setuptools

Shell script shebangs do not work

Open
#150 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug major
Dominant language
Python
Stars
2.9k
Forks
1.4k
Avg merge
1d 1h
Merged PRs (30d)
1

Description

Originally reported by: ryotakatsuki (Bitbucket: ryotakatsuki, GitHub: ryotakatsuki)


I am using a shell script wrapper to substitute my "python" binary, define some environment variables and call the real binary afterwards.

This results on the shell script being used as the shebang, which does not work in some Unix OS, specifically on OS X.

The solution would be to use "#!/usr/bin/env path/to/script.sh" as the shebang. Looking into the code I saw a fix is already applied for Jython (http://bugs.jython.org/issue1112) so I simply extended it.


Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing where setuptools generates script shebangs and compare that path with the existing Jython fix mentioned in the issue. Confirm the generated wrapper uses the proposed env-based shebang and verify it on OS X or another affected Unix system.

Written by the indexing model from the issue text.

Assessment

Tech stack
python, shell
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.