This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

作者 gordonmessmer
收信人 Jeffrey.Kintscher, benjamin.peterson, gordonmessmer, hroncok, lemburg, mattheww, ncoghlan, serhiy.storchaka, vstinner
日期 2019-07-24.04:24:55
SpamBayes Score -1.0
Marked as misclassified
Message-id <1563942296.23.0.479732198666.issue30755@roundup.psfhosted.org>
In-reply-to
内容
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.
历史
日期 用户 动作 参数
2019-07-24 04:24:56gordonmessmer修改recipients: + gordonmessmer, lemburg, ncoghlan, vstinner, mattheww, benjamin.peterson, serhiy.storchaka, hroncok, Jeffrey.Kintscher
2019-07-24 04:24:56gordonmessmer修改messageid: <1563942296.23.0.479732198666.issue30755@roundup.psfhosted.org>
2019-07-24 04:24:56gordonmessmer链接issue30755 messages
2019-07-24 04:24:55gordonmessmer创建