python / python/cpython

Add structured version info for pyexpat

未关闭
#157,473 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

3.16 extension-modules topic-XML type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

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
  • gh-157474

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

从 pyexpat.c 开始,这里公开了 Expat 版本宏和运行时版本 API。跟踪现有的 VERSION_INFO 和 version_info 定义,然后验证构建时版本是否被单独公开,以及 version_info 是否具有命名元组行为。如果有 pyexpat API 测试,请检查这些测试,并确认当两个版本不同时,它们都能被正确报告。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, python
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。