python / python/cpython

xml.dom.minidom uses names from superseded drafts of DOM Level 3

未關閉
#156,667 3 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

docs topic-XML
主要語言
Python
星號
77.2k
分支
36k
PR 合併指標
PR 指標待擷取

描述

Several public attributes and methods of xml.dom.minidom come from working drafts of DOM Level 3, and were renamed before the Recommendation was published in 2004. The code says so itself:

# DOM Level 3 attributes, based on the 22 Oct 2002 draft
# DOM Level 3 (WD 9 April 2002)
minidom DOM Level 3 Core
Node.getInterface(), DOMImplementation.getInterface() getFeature()
Attr.schemaType, Element.schemaType schemaTypeInfo
Text.isWhitespaceInElementContent isElementContentWhitespace
Document.actualEncoding inputEncoding
Document.encoding xmlEncoding
Document.version xmlVersion
Document.standalone xmlStandalone
Entity.actualEncoding, Entity.encoding, Entity.version the same three renames

Document.errorHandler is from the same drafts; in the Recommendation it became a parameter of domConfig.

None of these names are documented, so nothing tells a user that they are neither DOM Level 1/2 (which xml.dom documents) nor DOM Level 3 (which minidom does not claim, see gh-50348).

Adding the specified names and keeping the old ones as aliases breaks nothing, and lets the documented API match the specification.

Linked PRs
  • gh-156696

貢獻指南

開啟貢獻指南

從這裡開始

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

研究方向

從 xml.dom.minidom 入口點開始,檢查 issue 中列出的公開屬性與方法,以及它們的 DOM Level 3 註解。將每個目前的名稱與 Recommendation 中指定的名稱進行比較;當指定的名稱可作為別名使用且不會破壞舊名稱,並且現有測試中有適當的涵蓋時,即表示完成。

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

評估

技術堆疊
python
領域
backend
Issue 類型
功能
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
描述清楚
新手友好度
35/100

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

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