bpo-45321: Add missing error codes to module xml.parsers.expat.errors (GH-30188)

The idea is to ensure that module `xml.parsers.expat.errors`
contains all known error codes and messages,
even when CPython is compiled or run with an outdated version of libexpat.

https://bugs.python.org/issue45321
This commit is contained in:
Sebastian Pipping 2021-12-31 10:57:00 +01:00 committed by GitHub
parent 35628e4cde
commit e18d81569f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 126 additions and 49 deletions

View file

@ -867,6 +867,40 @@ The ``errors`` module has the following attributes:
.. data:: XML_ERROR_SUSPEND_PE
.. data:: XML_ERROR_RESERVED_PREFIX_XML
An attempt was made to
undeclare reserved namespace prefix ``xml``
or to bind it to another namespace URI.
.. data:: XML_ERROR_RESERVED_PREFIX_XMLNS
An attempt was made to declare or undeclare reserved namespace prefix ``xmlns``.
.. data:: XML_ERROR_RESERVED_NAMESPACE_URI
An attempt was made to bind the URI of one the reserved namespace
prefixes ``xml`` and ``xmlns`` to another namespace prefix.
.. data:: XML_ERROR_INVALID_ARGUMENT
This should not be reported to Python applications.
.. data:: XML_ERROR_NO_BUFFER
This should not be reported to Python applications.
.. data:: XML_ERROR_AMPLIFICATION_LIMIT_BREACH
The limit on input amplification factor (from DTD and entities)
has been breached.
.. rubric:: Footnotes
.. [1] The encoding string included in XML output should conform to the