Set LC_ALL=C.UTF-8 in docker containers#3423
Merged
Eijebong merged 1 commit intomozilla-releng:mainfrom Jun 24, 2025
Merged
Conversation
bhearsum
approved these changes
Jun 23, 2025
jcristau
requested changes
Jun 24, 2025
Contributor
jcristau
left a comment
There was a problem hiding this comment.
Please either set LC_CTYPE or LC_ALL, not LANG (which can be overridden by any of the other two).
Python 3.13 dropped that in docker-library/python#895 Without this, running balrog locally results in ``` balrogadmin-1 | File "/app/uwsgi/admin.wsgi", line 74, in <module> balrogadmin-1 | from auslib.web.admin.base import app as application # noqa balrogadmin-1 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ balrogadmin-1 | File "/app/src/auslib/web/admin/base.py", line 29, in <module> balrogadmin-1 | .add_spec(path.join(current_dir, "swagger/api.yml")) balrogadmin-1 | ~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/specsynthase/specbuilder.py", line 44, in add_spec balrogadmin-1 | spec = self._load_spec(file_name) balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/specsynthase/specbuilder.py", line 13, in _load_spec balrogadmin-1 | return yaml.load(spec_file, Loader=yaml.FullLoader) balrogadmin-1 | ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/yaml/__init__.py", line 79, in load balrogadmin-1 | loader = Loader(stream) balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/yaml/loader.py", line 24, in __init__ balrogadmin-1 | Reader.__init__(self, stream) balrogadmin-1 | ~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/yaml/reader.py", line 85, in __init__ balrogadmin-1 | self.determine_encoding() balrogadmin-1 | ~~~~~~~~~~~~~~~~~~~~~~~^^ balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/yaml/reader.py", line 124, in determine_encoding balrogadmin-1 | self.update_raw() balrogadmin-1 | ~~~~~~~~~~~~~~~^^ balrogadmin-1 | File "/usr/local/lib/python3.13/site-packages/yaml/reader.py", line 178, in update_raw balrogadmin-1 | data = self.stream.read(size) balrogadmin-1 | File "/usr/local/lib/python3.13/encodings/ascii.py", line 26, in decode balrogadmin-1 | return codecs.ascii_decode(input, self.errors)[0] balrogadmin-1 | ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^ balrogadmin-1 | UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 773: ordinal not in range(128) balrogadmin-1 exited with code 22 ``` Because our swagger config contains some non ASCII characters so it cannot be read to a string if `LANG` is unset which defaults to `POSIX` (at least on my system). I probably went overboard by setting it into every python container as some might not actually require it, but I feel like everyone would expect a UTF-8 locale to be set.
774cae5 to
125d34f
Compare
LANG=C.UTF-8 in docker containersLC_ALL=C.UTF-8 in docker containers
jcristau
approved these changes
Jun 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Python 3.13 dropped that in docker-library/python#895 Without this, running balrog locally results in
Because our swagger config contains some non ASCII characters so it cannot be read to a string if
LANGis unset which defaults toPOSIX(at least on my system).I probably went overboard by setting it into every python container as some might not actually require it, but I feel like everyone would expect a UTF-8 locale to be set.