Message348367
As an example, let's consider dnf's i18n setup:
try:
dnf.pycomp.setlocale(locale.LC_ALL, '')
except locale.Error:
# default to C.UTF-8 or C locale if we got a failure.
try:
dnf.pycomp.setlocale(locale.LC_ALL, 'C.UTF-8')
os.environ['LC_ALL'] = 'C.UTF-8'
except locale.Error:
dnf.pycomp.setlocale(locale.LC_ALL, 'C')
os.environ['LC_ALL'] = 'C'
If setting the environment-specified locale fails, dnf will attempt to set the locale
to C.UTF-8, and if that fails it will set the locale to C. This seems like an ideal
process. If the expected locale is missing, dnf will attempt to at least use UTF-8,
before falling back to the C locale.
Unfortunately, because of the alias, this process will be unable to set the 'C.UTF-8'
locale on systems which do not have the 'en_US' locale installed. This renders
system support for 'C.UTF-8' unusable when no locales are installed. |
|
Date |
User |
Action |
Args |
2019-07-24 04:24:56 | gordonmessmer | set | recipients:
+ gordonmessmer, lemburg, ncoghlan, vstinner, mattheww, benjamin.peterson, serhiy.storchaka, hroncok, Jeffrey.Kintscher |
2019-07-24 04:24:56 | gordonmessmer | set | messageid: <1563942296.23.0.479732198666.issue30755@roundup.psfhosted.org> |
2019-07-24 04:24:56 | gordonmessmer | link | issue30755 messages |
2019-07-24 04:24:55 | gordonmessmer | create | |
|