← Back to issue list

snapcraft plugin for python2/3 should fix incorrect shebang on pkg_resources-generated scripts

View original Launchpad issue

Metadata

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

Current evaluation

Fixed by snapcraft#1719 (commit 8ed95e68a), which updated Python shebang rewriting to handle pkg_resources-generated console scripts with interpreter arguments.

Resolution: closed resolved

Reason: Python shebang rewriting was corrected in snapcraft#1719, merged as commit 8ed95e68a, to account for interpreter arguments and properly rewrite pkg_resources-style entry-point scripts.

Evaluated by: mr-cal-bot

No scores available.

Issue body

#!/usr/bin/python3 This is the shebang generated for a typical pkg_resources-based console_scripts entry point. This should be patched to contain #!/usr/bin/env python3

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by snapcraft#1719 (commit 8ed95e68a), which updated Python shebang rewriting to handle pkg_resources-generated console scripts with interpreter arguments.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/snapcraft#680 (commit 066d653b5), which rewrote Python-plugin-generated shebangs to use env instead of absolute interpreter paths.
qwen/qwen3.6-35b-a3b — — Closed without resolution. The request to patch pkg_resources-generated shebangs from /usr/bin/python3 to /usr/bin/env python3 in the snapcraft plugin was abandoned.
qwen/qwen3.6-35b-a3b — — Closed without resolution or associated pull request. The snapcraft plugin shebang correction for pkg_resources scripts was abandoned, with no fix implemented or tracked.

Update history

Date Change
created

Related work

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

    The merged change explicitly updated shebang rewriting to account for Python shebang arguments.

Related issues

Issue Project State Summary Similarity
#1602379 'snapcraft' and 'snapcraft-parser' need to use '#!/usr/bin/env python3' in the shebang line snapcraft (launchpad) closed Updated snapcraft and snapcraft-parser to use #!/usr/bin/env python3 via merged PR snapcore/snapcraft#649 (commit c156f111c).
75%
#2112 repo: fix all python shebangs in stage-packages snapcraft merged PR #2112 (commit 829adaec4) merged: snapcraft now rewrites Python shebangs across the whole part instead of only bin/, and drops archived sitecustomize.py, fixing LP: #1766662.
74%
#1673451 fix shebangs should fix versioned python snapcraft (launchpad) closed Fixed by merged snapcore/snapcraft PR #1719, which made shebang rewriting account for versioned Python interpreters.
72%