shell.py 文件源码

python
阅读 20 收藏 0 点赞 0 评论 0

项目:maas 作者: maas 项目源码 文件源码
def select_c_utf8_bytes_locale(environ=os.environb):
    """Return a dict containing an environment that uses the C.UTF-8 locale.

    C.UTF-8 is the new en_US.UTF-8, i.e. it's the new default locale when no
    other locale makes sense.

    This function takes a starting environment, by default that of the current
    process, strips away all locale and language settings (i.e. LC_* and LANG)
    and selects C.UTF-8 in their place.

    :param environ: A base environment to start from. By default this is
        ``os.environb``. It will not be modified.
    """
    environ = {
        name: value for name, value in environ.items()
        if not name.startswith(b'LC_')
    }
    environ.update({
        b'LC_ALL': b'C.UTF-8',
        b'LANG': b'C.UTF-8',
        b'LANGUAGE': b'C.UTF-8',
    })
    return environ
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号