fix(python-plugin): use absolute path to python interpreter on core26
Metadata
Current evaluation
Merged PR #6437 (commit 35853fff8) fixes #6411: python-plugin now rewrites shebangs to the absolute /snap/<name>/bin/python3 path on core26 instead of relying on env PATH lookup.
Resolution: closed resolved
Reason: PR #6437 was merged with 2 approvals and all CI checks green, landing as commit 35853fff8; it closes issue #6411 by replacing the 'env'-based shebang interpreter resolution with an absolute interpreter path and adding spread test coverage that forces execution via the shebang.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Fixes #6411.
The fix here was to adjust the existing shebang rewriting infrastructure to input an absolute path instead of hinging upon `env`, which was resolving Python interpreters in the wrong order.
The spread test changes ensure this works by forcing execution through the shebang instead of going the "easy route" and invoking the app with Python.
An open question I have is regarding documentation. Should this even be documented? It's a difference between core24 and core26 Python snaps, but it doesn't affect the uv plugin (doesn't rewrite shebangs in the first place, no need!) and so it can't easily be inserted into `_python_common.rst` as it exists today. I think that most people shouldn't bump into this issue though, because they've either patched the problem themselves, were already invoking with `python`, or the snap was just simply broken.
---
- [ ] I've followed the [contribution guidelines](https://github.com/canonical/snapcraft/blob/main/CONTRIBUTING.md).
- [ ] I've signed the [CLA](http://www.ubuntu.com/legal/contributors/).
- [ ] I've successfully run `make lint && make test`.
- [ ] I've added or updated any relevant documentation.
- [ ] In documents I changed, I [added a meta description](https://canonical-starflow.readthedocs-hosted.com/how-to/add-a-page-meta-description/) if one was missing.
- [ ] I've updated the relevant release notes.
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #6437 (commit 35853fff8) fixes #6411: python-plugin now rewrites shebangs to the absolute /snap/<name>/bin/python3 path on core26 instead of relying on env PATH lookup. | |
| stealth/space-bunny-alpha | — | closed resolved | Merged PR #6437 (commit 35853fff8), fixing #6411 by using the snap's absolute Python interpreter path in rewritten shebangs on core26. | |
| stealth/space-bunny-alpha |
Impact:
57
Quick Win:
20
Complexity:
48
Confidence:
90
Actionability:
67
|
needs review | Switches Python plugin script shebangs to an absolute interpreter on core26 and adjusts spread tests to exercise them directly; CI has no failures but remains incomplete. | |
| qwen/qwen3.6-35b-a3b |
Impact:
65
Quick Win:
25
Complexity:
35
Confidence:
75
Actionability:
60
|
needs review | Fixes Python plugin shebang rewriting to use absolute paths on core26 instead of relying on env, resolving conflicting interpreter issues. Fresh PR awaiting review with one failing lint check. |
Update history
| Date | Change |
|---|---|
| merged | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| updated | |
| created |
Related work
-
Duplicate Of:
canonical/snapcraft#6411
(confidence 95%)
Issue #6411 is the underlying bug report ('The Python plugin can create conflicting interpreters') closed by this PR.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #6411 The Python plugin can create conflicting interpreters | snapcraft | closed | Closed as fixed by merged PR #6437 (commit 35853fff8): the Python plugin now rewrites shebangs on core26+ to the absolute /snap/<name>/bin/python3 path, removing PATH-order ambiguity with staged /usr/bin/python3. | |
| #6089 fix(plugins/python): fix core26 builds | snapcraft | merged | Merged #6089 fixed #6020 by enabling the Python plugin for strictly confined core26 snaps and adding spread tests; released in Snapcraft 8.14.3. | |
| #6020 Most Python-based snaps can't build on core26 | snapcraft | closed | Fixed by merged PR #6089 (commit 6ee41173c) and released in Snapcraft 8.14.3, enabling Python plugin builds on core26. |