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