Skip to content

Expose error code XML_ERROR_NOT_STARTED of Expat >=2.6.4 #126624

Closed

Description

@hartwork

Bug report

Bug description:

The error code was introduced by a security fix (at libexpat/libexpat@51c7019) but the XML_StopParser C-API is not exposed through CPython yet so it should not be possible to encounter such error. In particular, exposing the error code can be considered a feature or postpone until #59979 is resolved.

CPython versions tested on:

3.9, 3.10, 3.11, 3.12, 3.13, 3.14, CPython main branch

Operating systems tested on:

Linux, macOS, Windows, Other

Linked PRs

Activity

  1. changed the title [-]Please expose the new error code `XML_ERROR_NOT_STARTED` of Expat >=2.6.4[/-] [+]Please expose error code `XML_ERROR_NOT_STARTED` of Expat >=2.6.4[/+] on Nov 9, 2024
  2. added
    type-featureA feature request or enhancement
    and removed
    type-bugAn unexpected behavior, bug, or error
    on Nov 9, 2024
  3. picnixz commented on Nov 9, 2024

    @picnixz
    Member

    @hartwork Is this one needed for security reasons or bug fixes? (I assumed no, hence the "feature request"). Depending on your answer, we would need to backport it.

  4. hartwork commented on Nov 9, 2024

    @hartwork
    ContributorAuthor

    @picnixz it was introduced by a security fix (at libexpat/libexpat@51c7019). I would like to vote for backporting because the underlying Expat is moving and hence could start producing that error code and distros will be backporting the security fix. I can help with the backport as needed. What do you think?

  5. picnixz commented on Nov 9, 2024

    @picnixz
    Member

    I would like to vote for backporting

    In general, we have a strict policy of what we backport and when. Bug fixes are backported up to the oldstable version (3.12) while security fixes are backported to all security branches (3.9+).

    could start producing that error code

    If it can produce that error code and can be reachable from Python (not C) code, then I think it makes sense to backport it as far as #126623 is backported. Having had a look at your PR, I think it can be reachable from pure Python code (namely the user can see such error). So I'll categorize this one as a security issue as well (not strictly a security issue, just that it's a follow-up to #126623).

    I can help with the backport as needed

    I don't think it'll be needed since the bot will likely handle them if there's no conflict. If there are conflicts, they'll likely be easy to fix (if not, you can definitely help).

  6. added and removed
    type-featureA feature request or enhancement
    on Nov 9, 2024
  7. changed the title [-]Please expose error code `XML_ERROR_NOT_STARTED` of Expat >=2.6.4[/-] [+]Expose error code `XML_ERROR_NOT_STARTED` of Expat >=2.6.4[/+] on Nov 9, 2024
  8. 5 remaining items

  9. added
    type-featureA feature request or enhancement
    and removed
    3.11only security fixes
    3.12only security fixes
    3.13only security fixes
    3.14bugs and security fixes
    on Nov 9, 2024
  10. hartwork commented on Nov 9, 2024

    @hartwork
    ContributorAuthor

    @picnixz I learned something in the process, no worries. Thanks for the discussion.

  11. added a commit that references this issue on Jan 2, 2025
  12. Eclips4 commented on Jan 2, 2025

    @Eclips4
    Member

    Thank you @hartwork!

  13. added a commit that references this issue on Jan 8, 2025
  14. SoeAung95 commented on Jan 27, 2025

    @SoeAung95

    enum XML_Status XMLCALL
    XML_ResumeParser(XML_Parser p);

  15. SoeAung95 commented on Jan 27, 2025

    @SoeAung95

    enum XML_Status XMLCALL
    XML_ResumeParser(XML_Parser p);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions