On this page
pyexpat.ErrorString
Prev: pyexpat.error | Up: pyexpat | Next: pyexpat.ExpatError
Rel: pyexpat.error, pyexpat.ExpatError, pyexpat.ParserCreate, pyexpat.XMLParserType
Ref: docs.python.org — pyexpat.ErrorString
Tags: #public #python3 #stdlib #pyexpat
Import
import pyexpat
from pyexpat import ErrorString
Signature & Overview
pyexpat.ErrorString(code, /)
Returns string error for given number.
Usage
import pyexpat
msg = pyexpat.ErrorString(pyexpat.errors.codes[pyexpat.errors.XML_ERROR_SYNTAX])
assert "syntax" in msg.lower()
Gotchas
- Maps numeric Expat error codes to human-readable messages.
REPL Inspect
from pyexpat import ErrorString
help(ErrorString)
Linked from
Related notes
- tuts/python3/stdlib_module/pyexpat/error Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/ExpatError Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/ParserCreate Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat/XMLParserType Linked here; links to this page; shared tags: #pyexpat, #stdlib
- tuts/python3/stdlib_module/pyexpat Linked here; links to this page; shared tags: #stdlib
- tuts/c/stdlib shared tags: #stdlib
- tuts/c/stdlib/assert shared tags: #stdlib
- tuts/c/stdlib/assert/assert shared tags: #stdlib
- tuts/c/stdlib/assert/static_assert shared tags: #stdlib
- tuts/c/stdlib/ctype shared tags: #stdlib