]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-126624: Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 (#126625)
authorSebastian Pipping <sebastian@pipping.org>
Thu, 2 Jan 2025 12:54:38 +0000 (13:54 +0100)
committerGitHub <noreply@github.com>
Thu, 2 Jan 2025 12:54:38 +0000 (14:54 +0200)
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 <10796600+picnixz@users.noreply.github.com>
Doc/library/pyexpat.rst
Misc/NEWS.d/next/Library/2024-11-09-15-59-51.gh-issue-126624.bN53Va.rst [new file with mode: 0644]
Modules/pyexpat.c

index c0e9999f4b1270e87ec940ccac368250a9fd9c8b..0f3b58ef6ea5af1e02e72870ac7320ae62c831da 100644 (file)
@@ -941,6 +941,13 @@ 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.
+
+   .. versionadded:: next
+
+
 .. rubric:: Footnotes
 
 .. [1] The encoding string included in XML output should conform to the
diff --git a/Misc/NEWS.d/next/Library/2024-11-09-15-59-51.gh-issue-126624.bN53Va.rst b/Misc/NEWS.d/next/Library/2024-11-09-15-59-51.gh-issue-126624.bN53Va.rst
new file mode 100644 (file)
index 0000000..468840a
--- /dev/null
@@ -0,0 +1,2 @@
+Expose error code :data:`~xml.parsers.expat.errors.XML_ERROR_NOT_STARTED`
+of Expat >=2.6.4 in :mod:`xml.parsers.expat.errors`.
index cf7714e7656205e2302ab231c930d6cc41aabb25..9931ca2a8d47498f9aae8b1ff245896f3366dbb4 100644 (file)
@@ -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