On this page
locale.Error
Prev: locale.currency | Up: locale | Next: locale.format_string
Rel: locale.atof, locale.atoi, locale.currency, locale.format_string
Ref: docs.python.org โ locale.Error
Tags: #public #python3 #stdlib #locale
Import
import locale
from locale import Error
Signature & Overview
locale.Error(...)
locale.Error class.
Methods & Attributes
Error.add_note(self, note, /)โ Add a note to the exceptionError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import locale
try:
locale.setlocale(locale.LC_ALL, "nonexistent_locale_xyz")
except locale.Error:
assert True
Gotchas
- Raised when a requested locale is not installed on the OS (common in minimal Docker containers).
REPL Inspect
from locale import Error
help(Error)
Linked from
- tuts/python3/stdlib_module/locale
- tuts/python3/stdlib_module/locale/atof
- tuts/python3/stdlib_module/locale/atoi
- tuts/python3/stdlib_module/locale/currency
- tuts/python3/stdlib_module/locale/format_string
- tuts/python3/stdlib_module/locale/getdefaultlocale
- tuts/python3/stdlib_module/locale/getencoding
- tuts/python3/stdlib_module/locale/getlocale
- tuts/python3/stdlib_module/locale/getpreferredencoding
- tuts/python3/stdlib_module/locale/localeconv
- tuts/python3/stdlib_module/locale/normalize
- tuts/python3/stdlib_module/locale/setlocale
- tuts/python3/stdlib_module/locale/str
- tuts/python3/stdlib_module/locale/strcoll
- tuts/python3/stdlib_module/locale/strxfrm
Related notes
- tuts/python3/stdlib_module/locale/atof Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/atoi Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/currency Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/format_string Linked here; links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/locale/getdefaultlocale links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getencoding links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getlocale links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/getpreferredencoding links to this page; shared tags: #locale, #stdlib
- tuts/python3/stdlib_module/locale/localeconv links to this page; shared tags: #locale, #stdlib