← Back to issue list

Applications requiring UTF-8 fail

View original Launchpad issue

Metadata

Project
snapcraft (launchpad)
Number
#1804845
Type
issue
State
open
Author
~merlijn-sebrechts
Labels
Created
Updated
Closed

Current evaluation

Python snaps fail when host locale is not available inside the snap, causing UTF-8 fallback to ASCII. Issue requests snapcraft provide a built-in fix (e.g. default LC_ALL=C.UTF-8). Open since 2017, no maintainer response, no labels.

Suggested action: needs triage

Reason: The issue is 2838 days old with zero comments, no labels, and no maintainer interaction, indicating it has never been triaged. However, the underlying problem (locale/UTF-8 handling in snaps) is a real and recurring issue affecting many Python-based snaps, and the repo still contains 14 references to C.UTF-8 and 11 to LC_ALL, suggesting the topic remains relevant. It is not clearly stale or irrelevant — the problem may still exist in current snapcraft versions — so closing would be premature without verification. A maintainer should assess whether modern snapcraft (core22/core24 bases) already handles this or if a default locale injection is warranted.

Impact: 65 Quick Win: 29.25 Staleness: 85 Complexity: 55 Confidence: 55 Support Request: 30

Issue body

UTF-8 support in snapcraft is still quite poor. For example, Python applications requiring UTF-8 fail on most systems because the snap only contains `C.UTF-8`, not the locale of the host machine. As a result, python seems to fallback to ASCII, breaking many libraries. Existing python snaps solve this in a number of ways: 1. A wrapper script that sets LC_ALL to "C.UTF-8": https://github.com/juju/charm-tools/blob/c3cee3672978d19cb66b7a301c0fbae9542eb58d/helpers/snap-wrappers/charm#L8 2. Change the application itself to fallback to "C.UTF-8": https://github.com/snapcore/snapcraft/blob/4042556714400d2156cb89efb86bf294500d1f41/snapcraft/cli/__main__.py#L40 3. Setting LC_ALL to "C.UTF-8" in snapcraft.yaml (either using `environment` or by prefixing the command string): https://github.com/warner/magic-wormhole/blob/13102d3eeded33a4ad749078de9bbca5000ffbe6/snapcraft.yaml#L22 Since so many people have this issue, would it be possible to provide a fix for it in snapcraft? Below you can find an example for the click library failing because the locale fallsback to ASCII. ``` Traceback (most recent call last):   File "/snap/gh-teacher/x4/bin/gh-tools", line 172, in <module>     cli(obj={}) #pylint: disable=E1123,E1120   File "/snap/gh-teacher/x4/lib/python3.5/site-packages/click/core.py", line 764, in __call__     return self.main(*args, **kwargs)   File "/snap/gh-teacher/x4/lib/python3.5/site-packages/click/core.py", line 696, in main     _verify_python3_env()   File "/snap/gh-teacher/x4/lib/python3.5/site-packages/click/_unicodefun.py", line 124, in _verify_python3_env     ' mitigation steps.' + extra RuntimeError: Click will abort further execution because Python 3 was configured to use ASCII as encoding for the environment. Consult https://click.palletsprojects.com/en/7.x/python3/ for mitigation steps. This system supports the C.UTF-8 locale which is recommended. You might be able to resolve your issue by exporting the following environment variables:     export LC_ALL=C.UTF-8     export LANG=C.UTF-8 Click discovered that you exported a UTF-8 locale but the locale system could not pick up from it because it does not exist. The exported locale is "en_US.UTF-8" but it is not supported ``` Related bug in snapcraft itself: https://bugs.launchpad.net/ubuntu/+source/snapd/+bug/1576411

Evaluation history

Date Model Scores Action Summary
qwen/qwen3.8-27b
Impact: 65
Quick Win: 29.25
Staleness: 85
Complexity: 55
Confidence: 55
Support Request: 30
needs triage Python snaps fail when host locale is not available inside the snap, causing UTF-8 fallback to ASCII. Issue requests snapcraft provide a built-in fix (e.g. default LC_ALL=C.UTF-8). Open since 2017, no maintainer response, no labels.
qwen/qwen3.6-35b-a3b
Staleness: 95
Complexity: 30
Confidence: 85
Support Request: 70
close stale Reports UTF-8 locale failures in Python snaps due to missing host locales, suggesting snapcraft should fix this by default. Issue is over 7 years old with no maintainer response.
qwen/qwen3.6-35b-a3b
Staleness: 98
Complexity: 45
Confidence: 90
Support Request: 35
close stale Extremely old report about Python locale failures in snaps due to missing host locale support. No maintainer interaction, multiple established workarounds exist, and the reported environment is obsolete.
qwen3.6-35b-a3b-mtp-q6
Staleness: 95
Complexity: 65
Confidence: 75
Support Request: 20
close stale Untriaged 2017 issue reporting UTF-8 locale failures in Python snaps. Requests a snapcraft-level fix but has zero maintainer comments and over seven years of inactivity. Locale handling is now a known limitation with established workarounds.
qwen3.6-35b-a3b-mtp-q6
Staleness: 98
Complexity: 25
Confidence: 90
Support Request: 15
close stale Report about Python apps failing due to missing host locale in snaps, which only contain C.UTF-8. The issue has zero maintainer interaction, no labels, and remains open after over seven years.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.