← Back to issue list

Python shebang rewrite doesn't support shebang args

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1730472
Type
issue
State
closed
Author
~kyrofa
Labels
—
Created
Updated
Closed

Current evaluation

Python shebang rewriting now preserves interpreter arguments; fixed by merged PR snapcraft#1719 in commit 8ed95e68a.

Resolution: closed resolved

Reason: Merged PR #1719, commit 8ed95e68a, updated shebang rewriting to account for Python interpreter arguments and resolved the reported Launchpad bug.

Evaluated by: mr-cal-bot

No scores available.

Issue body

A few different plugins (python, catkin) rewrite shebangs like #!/usr/bin/python3 to #!/usr/bin/env python3 . For the most part, this works great. However, some projects (take a look at /usr/bin/lsb_release) actually pass arguments to Python in the shebang, e.g. #!/usr/bin/python3 -Es . /usr/bin/env doesn't support args like this-- it ends up searching for the command 'python3 -Es' which of course doesn't exist. We need to be smarter about this.

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Python shebang rewriting now preserves interpreter arguments; fixed by merged PR snapcraft#1719 in commit 8ed95e68a.
stealth/space-bunny-alpha — closed resolved Python shebang rewriting now preserves interpreter arguments; fixed by merged PR #1719 in commit 8ed95e68a.
stealth/space-bunny-alpha — closed stale Closed without a documented resolution: the Python/catkin shebang-argument request has no linked PR, commit, or maintainer explanation in the available record.
qwen/qwen3.6-35b-a3b — — Abandoned. Closed without resolution or implementation, leaving the shebang argument handling limitation unaddressed.
qwen/qwen3.6-35b-a3b — — Closed without a fix. The shebang rewriting logic remains unable to handle Python arguments, leaving the reported bug unresolved.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The reported shebang argument handling bug was abandoned due to inactivity, with no fix implemented or merged.
qwen3.6-35b-a3b-mtp-q6 — — Closed without resolution due to inactivity. The shebang rewriting logic still fails to preserve Python arguments, breaking scripts that pass flags like -Es to env. No fix or workaround was implemented.

Update history

Date Change
created

Related work

  • Likely Fixed By: snapcraft#1719 (confidence 100%)

    Merged PR 1719 is explicitly identified as the fix and was committed as 8ed95e68a.

Related issues

Issue Project State Summary Similarity
#1766662 python shebang rewriting can fail in presence of a stage-package snapcraft (launchpad) closed Fixed by merged canonical/snapcraft PR #2112 (commit 829adaec4), broadening Python shebang rewriting from bin directories to all stage-packages so later parts stage successfully.
72%
#1719 many: account for python shebang args in rewrite snapcraft merged Merged #1719 as commit 8ed95e68a, preserving Python shebang arguments and centralizing rewrites; fixes LP bugs #1730472 and #1673451.
71%