Bug #2116
[libretools][librechroot] uses wrong locale setting
0%
Description
Whenever you create a new chroot, the only locales generated by locale-gen are en_US.UTF-8
and de_DE.UTF-8
. However, as some devs (like me) may use other locales in their main systems, then it occurs an error with the chroot locale setting (or is this a feature?):
(main)$ locale LANG=es_CL.UTF-8 LC_CTYPE="es_CL.UTF-8" LC_NUMERIC="es_CL.UTF-8" LC_TIME="es_CL.UTF-8" LC_COLLATE="es_CL.UTF-8" LC_MONETARY="es_CL.UTF-8" LC_MESSAGES="es_CL.UTF-8" LC_PAPER="es_CL.UTF-8" LC_NAME="es_CL.UTF-8" LC_ADDRESS="es_CL.UTF-8" LC_TELEPHONE="es_CL.UTF-8" LC_MEASUREMENT="es_CL.UTF-8" LC_IDENTIFICATION="es_CL.UTF-8" LC_ALL=
(chroot)$ locale LANG=es_CL.UTF-8 LC_CTYPE="es_CL.UTF-8" LC_NUMERIC="es_CL.UTF-8" LC_TIME="es_CL.UTF-8" LC_COLLATE="es_CL.UTF-8" LC_MONETARY="es_CL.UTF-8" LC_MESSAGES="es_CL.UTF-8" LC_PAPER="es_CL.UTF-8" LC_NAME="es_CL.UTF-8" LC_ADDRESS="es_CL.UTF-8" LC_TELEPHONE="es_CL.UTF-8" LC_MEASUREMENT="es_CL.UTF-8" LC_IDENTIFICATION="es_CL.UTF-8" LC_ALL=
This is what happens in my case. The problem with this is that as the chroot doesn't have the correct line in /etc/locale-gen
to include my system locale in the chroot, then sphinx-build falls into an error (this is what happens when trying to build the linux-libre documentation):
Traceback (most recent call last): File "/usr/bin/sphinx-build", line 11, in <module> load_entry_point('Sphinx==1.8.1', 'console_scripts', 'sphinx-build')() File "/usr/lib/python3.7/site-packages/sphinx/cmd/build.py", line 313, in main locale.setlocale(locale.LC_ALL, '') File "/usr/lib/python3.7/locale.py", line 604, in setlocale return _setlocale(category, locale) locale.Error: unsupported locale setting
I solved this by adding es_CL.UTF-8 UTF-8
to /etc/locale.gen
to the chroot, and then running locale-gen
. However, if there is a way to make the locale use "C" or one of the default locales, it would be better IMO (I think in the past is used to use "C", right?).
History
Updated by Megver83 over 4 years ago
- Subject changed from [libretools][librechroot] fix locale setting to [libretools][librechroot] uses wrong locale setting