On this page
  1. pyexpat.ErrorString
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

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

REPL Inspect

from pyexpat import ErrorString
help(ErrorString)

Linked from

Related notes