https://github.com/python/cpython/commit/8e48a6edc75ca67a34924bbe54463ca913ae6e58 commit: 8e48a6edc75ca67a34924bbe54463ca913ae6e58 branch: main author: Sebastian Pipping <[email protected]> committer: Eclips4 <[email protected]> date: 2025-01-02T14:54:38+02:00 summary:
gh-126624: Expose error code ``XML_ERROR_NOT_STARTED`` of Expat >=2.6.4 (#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]> files: A Misc/NEWS.d/next/Library/2024-11-09-15-59-51.gh-issue-126624.bN53Va.rst M Doc/library/pyexpat.rst M Modules/pyexpat.c diff --git a/Doc/library/pyexpat.rst b/Doc/library/pyexpat.rst index c0e9999f4b1270..0f3b58ef6ea5af 100644 --- a/Doc/library/pyexpat.rst +++ b/Doc/library/pyexpat.rst @@ -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 index 00000000000000..468840a651c253 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2024-11-09-15-59-51.gh-issue-126624.bN53Va.rst @@ -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`. diff --git a/Modules/pyexpat.c b/Modules/pyexpat.c index cf7714e7656205..9931ca2a8d4749 100644 --- a/Modules/pyexpat.c +++ b/Modules/pyexpat.c @@ -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 _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-checkins.python.org/ Member address: [email protected]
