Hacktoberfest 2026:維護者為十月標記出來的 issue,仍然開放、適合新手。 瀏覽 Hacktoberfest issue

Sync with importlib_metadata for Python 3.16

未關閉
#160,386 0 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

維護者通常 1 天內回覆

還沒有人認領這個 Issue。

評估

難度
4/5
預估耗時
3-5 天
新手友好度
48/100
Issue 類型
功能
描述清晰度
基本清楚
活躍度
活躍
技術堆疊
python
領域
backend, tooling

研究方向

Read the upstream importlib_metadata 9.0.1 and 9.1.0 changelogs linked in the issue, then compare their changes with Lib/importlib/metadata and its tests. Check each listed behavior and cleanup against the current Python 3.16 implementation; done when the applicable upstream changes are reflected and the relevant tests pass. The issue names _typing.py but does not identify specific test files.

由索引模型根據 Issue 內容生成。

描述

stdlib topic-importlib type-feature

Tracking issue for applying importlib_metadata changes to importlib.metadata in 3.16, continuing the pattern of #132947 (3.15) and #117089 (3.13).

This covers importlib_metadata 9.0.1 and 9.1.0:

  • Prefer the greater metadata directory when a path supplies more than one. Children are now considered in reverse lexicographic order, so stale metadata left behind by an interrupted or unclean upgrade no longer shadows the version in use (#100666).
  • Identify the distribution when a required metadata field is missing. Distribution.name and .version now raise a KeyError naming both the field and the distribution, and PathDistribution renders itself as its metadata path.
  • Defer EntryPoint.value validation until use. Construction no longer validates, so one malformed entry point no longer prevents entry points in other groups from being selected (python/importlib_metadata#523).
  • importlib.metadata.diagnose no longer crashes on a metadata directory with no metadata file, or whose metadata declares no name; such distributions are reported by their location (python/importlib_metadata#548).
  • SimplePath.joinpath and SimplePath.__truediv__ take other positional-only, so pathlib.Path satisfies the protocol under type checkers that compare parameter names (python/importlib_metadata#542).

Two further items that are cleanups rather than behavior changes:

  • Prepared.normalize returns to the re.sub implementation. The hand-rolled version from #143658 was reverted upstream, so keeping it here would be fresh drift.
  • Lib/importlib/metadata/_typing.py is removed along with its import. Its only export, md_none, lost its last call site when Distribution.metadata began raising MetadataNotFound (#143387), but the import line survived the merge that landed that change, leaving an unused module imported by nothing.
Linked PRs
  • gh-160387
主要語言
Python
星號
77.7k
分支
38.3k
平均合併
13 小時 43 分鐘
30 天內合併 PR
704

環境準備

在 Codespaces 中開啟

在瀏覽器裡用你自己的 GitHub 帳號啟動這個專案的開發容器。

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

python/cpython 的其他 Issue

查看 python/cpython 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。