Skip to content

Commit 496336b

Browse files
hartworkpicnixz
authored andcommitted
pythongh-126624: Expose error code XML_ERROR_NOT_STARTED of Expat >=2.6.4 (python#126625)
Expose error code ``XML_ERROR_NOT_STARTED`` in `xml.parsers.expat.errors` which was introduced in Expat 2.6.4. Co-authored-by: Bénédikt Tran <[email protected]>
1 parent 3ac998c commit 496336b

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

Doc/library/pyexpat.rst

+7
Original file line numberDiff line numberDiff line change
@@ -941,6 +941,13 @@ The ``errors`` module has the following attributes:
941941
has been breached.
942942

943943

944+
.. data:: XML_ERROR_NOT_STARTED
945+
946+
The parser was tried to be stopped or suspended before it started.
947+
948+
.. versionadded:: next
949+
950+
944951
.. rubric:: Footnotes
945952

946953
.. [1] The encoding string included in XML output should conform to the
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Expose error code :data:`~xml.parsers.expat.errors.XML_ERROR_NOT_STARTED`
2+
of Expat >=2.6.4 in :mod:`xml.parsers.expat.errors`.

Modules/pyexpat.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -1767,7 +1767,10 @@ struct ErrorInfo error_info_of[] = {
17671767
{"XML_ERROR_NO_BUFFER", "a successful prior call to function XML_GetBuffer is required"},
17681768

17691769
/* Added in 2.4.0. */
1770-
{"XML_ERROR_AMPLIFICATION_LIMIT_BREACH", "limit on input amplification factor (from DTD and entities) breached"}
1770+
{"XML_ERROR_AMPLIFICATION_LIMIT_BREACH", "limit on input amplification factor (from DTD and entities) breached"},
1771+
1772+
/* Added in 2.6.4. */
1773+
{"XML_ERROR_NOT_STARTED", "parser not started"},
17711774
};
17721775

17731776
static int

0 commit comments

Comments
 (0)