MCPcopy Index your code
hub / github.com/RustPython/RustPython / getlocale

Function getlocale

Lib/locale.py:587–603  ·  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

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

Callers 1

_print_localeFunction · 0.85

Calls 1

_parse_localenameFunction · 0.85

Tested by

no test coverage detected