pypa / pypa/setuptools

`easy_install.is_python_script` gets it wrong

Open
#355 0 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: qwcode (Bitbucket: qwcode, GitHub: qwcode)


easy_install.is_python_script determines whether a script is wrapped or simply copied over.

the order of the logic in the function is:

  1. if py ext, then python script
  2. if compiles without Syntax or TypeError, then python script
  3. if python shebang, then python script

in the case where a simple bash script compiles ok, it misreports it as python even though it has a non-python shebang.

I think the shebang check should come before the compile check.


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

Locate easy_install.is_python_script and read the existing extension, compile, and shebang checks. Reproduce the issue with a simple bash script that has a non-Python shebang, then verify that the function no longer identifies it as a Python script.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.