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)
| 585 | |
| 586 | |
| 587 | def 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 | |
| 605 | def setlocale(category, locale=None): |
| 606 |
no test coverage detected