MCPcopy Index your code
hub / github.com/python/cpython / getlocale

Function getlocale

Lib/locale.py:591–607  ·  view source on GitHub ↗

Returns the current setting for the given locale category as tuple (language code, encoding). category may be one of the LC_* value except LC_ALL. It defaults to LC_CTYPE. Except for the code 'C', the language code corresponds to RFC 1766. code and encodin

(category=LC_CTYPE)

Source from the content-addressed store, hash-verified

589
590
591def getlocale(category=LC_CTYPE):
592
593 """ Returns the current setting for the given locale category as
594 tuple (language code, encoding).
595
596 category may be one of the LC_* value except LC_ALL. It
597 defaults to LC_CTYPE.
598
599 Except for the code 'C', the language code corresponds to RFC
600 1766. code and encoding can be None in case the values cannot
601 be determined.
602
603 """
604 localename = _setlocale(category)
605 if category == LC_ALL and ';' in localename:
606 raise TypeError('category LC_ALL is not supported')
607 return _parse_localename(localename)
608
609def setlocale(category, locale=None):
610

Callers 1

_print_localeFunction · 0.85

Calls 1

_parse_localenameFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…