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)
| 589 | |
| 590 | |
| 591 | def 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 | |
| 609 | def setlocale(category, locale=None): |
| 610 |
no test coverage detected
searching dependent graphs…