This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Module xml.parsers.expat.errors misses error code constants of libexpat >=2.0
Type: enhancement Stage: resolved
Components: Extension Modules, XML Versions: Python 3.11
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, eli.bendersky, python-dev, scoder, sping
Priority: normal Keywords: patch

Created on 2021-09-29 12:49 by sping, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 30188 merged python-dev, 2021-12-18 21:41
Messages (2)
msg402866 - (view) Author: (sping) * Date: 2021-09-29 12:49
(This has been mention at https://bugs.python.org/issue44394#msg395642 before, but issue 44394 has been closed as fixed despite that part being forgotten, hence the dedicated ticket...)

Module `xml.parsers.expat.errors` and its docs need 6 more error code entries to be complete:

  /* Added in 2.0. */
  38 XML_ERROR_RESERVED_PREFIX_XML
  39 XML_ERROR_RESERVED_PREFIX_XMLNS
  40 XML_ERROR_RESERVED_NAMESPACE_URI

  /* Added in 2.2.1. */
  41 XML_ERROR_INVALID_ARGUMENT

  /* Added in 2.3.0. */
  42 XML_ERROR_NO_BUFFER

  /* Added in 2.4.0. */
  43 XML_ERROR_AMPLIFICATION_LIMIT_BREACH

The source for this is:
- https://github.com/libexpat/libexpat/blob/72d7ce953827fe08a56b8ea64092f208be6ffc5b/expat/lib/expat.h#L120-L129

The place where additions is needed is:
- https://github.com/python/cpython/blob/f76889a88720b56c8174f26a20a8e676a460c7a6/Modules/pyexpat.c#L1748
- https://github.com/python/cpython/blame/f76889a88720b56c8174f26a20a8e676a460c7a6/Doc/library/pyexpat.rst#L867

Thanks in advance.
msg409411 - (view) Author: Stefan Behnel (scoder) * (Python committer) Date: 2021-12-31 09:57
New changeset e18d81569fa0564f3bc7bcfd2fce26ec91ba0a6e by Sebastian Pipping in branch 'main':
bpo-45321: Add missing error codes to module `xml.parsers.expat.errors` (GH-30188)
https://github.com/python/cpython/commit/e18d81569fa0564f3bc7bcfd2fce26ec91ba0a6e
History
Date User Action Args
2022-04-11 14:59:50adminsetgithub: 89484
2021-12-31 09:59:05scodersetstatus: open -> closed
versions: - Python 3.6, Python 3.7, Python 3.8, Python 3.9, Python 3.10
resolution: fixed
components: + XML
type: enhancement
stage: patch review -> resolved
2021-12-31 09:57:32scodersetmessages: + msg409411
2021-12-26 11:20:04serhiy.storchakasetnosy: + scoder, eli.bendersky
2021-12-18 21:41:46python-devsetkeywords: + patch
nosy: + python-dev

pull_requests: + pull_request28408
stage: patch review
2021-10-02 14:45:29corona10setnosy: + corona10
2021-09-29 12:49:45spingcreate