locale.Error: unsupported locale setting exception when glibc locale files are not present
Created by: rathann
Information
- Solaar version: 1.0.3
- Distribution: Fedora
- Kernel version (ex.
uname -srmo
):Linux 5.7.11-200.fc32.x86_64 x86_64 GNU/Linux
- Output of
solaar show
: N/A
Describe the bug Any solaar invocation is failing with a traceback when locale.setlocale() call fails, e.g. due to missing glibc locale files for the currently set locale.
To Reproduce Steps to reproduce the behavior:
$ sudo dnf remove glibc-langpack-de
$ export LC_ALL=de_CH.UTF-8
$ export LANG=de_CH.UTF-8
$ solaar --help
Traceback (most recent call last):
File "/usr/bin/solaar", line 59, in <module>
import solaar.gtk
File "/usr/lib/python3.8/site-packages/solaar/gtk.py", line 29, in <module>
import solaar.i18n as _i18n
File "/usr/lib/python3.8/site-packages/solaar/i18n.py", line 50, in <module>
locale.setlocale(locale.LC_ALL, '')
File "/usr/lib64/python3.8/locale.py", line 608, in setlocale
return _setlocale(category, locale)
locale.Error: unsupported locale setting
$
Additional context Looks like #190 (closed) is still unfixed. Downstream bug report: https://bugzilla.redhat.com/show_bug.cgi?id=1811313 .