Skip to content

Commit

Permalink
pyexpat: Expose error code XML_ERROR_NOT_STARTED of Expat >=2.6.4
Browse files Browse the repository at this point in the history
  • Loading branch information
hartwork committed Nov 9, 2024
1 parent 6293d00 commit 090f254
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions Doc/library/pyexpat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -941,6 +941,11 @@ The ``errors`` module has the following attributes:
has been breached.


.. data:: XML_ERROR_NOT_STARTED

The parser was tried to be stopped or suspended before it started.


.. rubric:: Footnotes

.. [1] The encoding string included in XML output should conform to the
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 in :mod:`xml.parsers.expat.errors`.
5 changes: 4 additions & 1 deletion Modules/pyexpat.c
Original file line number Diff line number Diff line change
Expand Up @@ -1767,7 +1767,10 @@ struct ErrorInfo error_info_of[] = {
{"XML_ERROR_NO_BUFFER", "a successful prior call to function XML_GetBuffer is required"},

/* Added in 2.4.0. */
{"XML_ERROR_AMPLIFICATION_LIMIT_BREACH", "limit on input amplification factor (from DTD and entities) breached"}
{"XML_ERROR_AMPLIFICATION_LIMIT_BREACH", "limit on input amplification factor (from DTD and entities) breached"},

/* Added in 2.6.4. */
{"XML_ERROR_NOT_STARTED", "parser not started"},
};

static int
Expand Down

0 comments on commit 090f254

Please sign in to comment.