Skip to content

Add structured version info for pyexpat #157473

Description

@serhiy-storchaka

Feature or enhancement

pyexpat.EXPAT_VERSION (from XML_ExpatVersion()) and pyexpat.version_info (from XML_ExpatVersionInfo()) describe the Expat library loaded at runtime: both functions are compiled into libexpat from its XML_MAJOR_VERSION, XML_MINOR_VERSION and XML_MICRO_VERSION macros. The same macros evaluated in pyexpat.c give the version of the headers the module was built against, which is what the #if XML_COMBINED_VERSION >= ... checks in the module depend on. The two can differ when a system libexpat is used. The build-time version is not exposed to Python; it can only be inferred from which parser methods exist.

Add pyexpat.VERSION_INFO for the build-time version, and make pyexpat.version_info a named tuple.

Linked PRs

Activity

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

    3.16new features, bugs and security fixesextension-modulesC modules in the Modules dirtopic-XMLtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions