Python plugin with core24 and gnome extension broken
Metadata
Current evaluation
The core24 Python plugin with the gnome extension failed due to missing Python encodings. The bug was resolved, and the disabled test was re-enabled in pull request #5977.
Suggested action: —
No scores available.
Issue body
### Bug Description
Migration of the core22 plugin logic to core24 is broken.
This might as well be a gnome content snap problem, as such the test cannot be enabled
### To Reproduce
Pack the proposed snapcraft.yaml with the sources at https://github.com/canonical/snapcraft/tree/main/tests/spread/plugins/craft-parts/build-and-run-hello/python-hello/src
### Environment
spread 24.04
### snapcraft.yaml
```yaml
name: python-hello
version: "1.0"
summary: simple python application
description: build a python application using core22
base: core24
confinement: strict
apps:
python-hello:
command: bin/hello
extensions: [gnome]
parts:
hello:
plugin: python
source: src
```
### Relevant log output
```shell
# python-hello
Python path configuration:
PYTHONHOME = (not set)
PYTHONPATH = '/snap/python-hello/x1/gnome-platform/usr/lib/python3/dist-packages'
program name = 'python3'
isolated = 0
environment = 1
user site = 1
safe_path = 0
import site = 1
is in build tree = 0
stdlib dir = '/snap/gnome-46-2404-sdk/current/usr/lib/python3.12'
sys._base_executable = '/usr/bin/python3.12'
sys.base_prefix = '/snap/gnome-46-2404-sdk/current/usr'
sys.base_exec_prefix = '/snap/gnome-46-2404-sdk/current/usr'
sys.platlibdir = 'lib'
sys.executable = '/snap/python-hello/x1/bin/python3'
sys.prefix = '/snap/gnome-46-2404-sdk/current/usr'
sys.exec_prefix = '/snap/gnome-46-2404-sdk/current/usr'
sys.path = [
'/snap/python-hello/x1/gnome-platform/usr/lib/python3/dist-packages',
'/snap/gnome-46-2404-sdk/current/usr/lib/python312.zip',
'/snap/gnome-46-2404-sdk/current/usr/lib/python3.12',
'/snap/gnome-46-2404-sdk/current/usr/lib/python3.12/lib-dynload',
]
Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding
Python runtime state: core initialized
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007dc98b0a6740 (most recent call first):
<no Python frame>
```
### Additional context
_No response_
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | The core24 Python plugin with the gnome extension failed due to missing Python encodings. The bug was resolved, and the disabled test was re-enabled in pull request #5977. | |
| qwen/qwen3.6-35b-a3b | — | — | Migration of the core22 Python plugin to core24 caused a missing encodings module error with the gnome extension. The issue was resolved after the test began passing, with the test re-enabled in pull request #5977. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed. The previously disabled test now passes and was re-enabled in pull request #5977, resolving the core24 Python plugin and gnome extension issue. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Fixed the Python plugin failure with core24 and the gnome extension. The disabled test was re-enabled in pull request #5977 after verifying successful builds. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #4942 Python plugin is broken in core24 | snapcraft | closed | Fixed the Python plugin failure in core24 caused by Python 3.12 virtual environment changes. The problem was resolved and merged in pull request #4946. | |
| #4587 Improvements to the PythonPlugin for core24 | snapcraft | open | Braindump of four proposed improvements to the Python plugin for core24 (linter for bad interpreter symlinks, shebang linter, post-prime shebang rewriting, gnome extension interplay). Open, unlabelled, no maintainer response beyond a Jira sync bot; related core24 Python plugin work has since landed. |