python / python/cpython

xml.dom.minidom: the DOM Level 3 Load and Save API is mostly unimplemented

Abierto
#156,668 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

stdlib topic-XML type-feature
Lenguaje dominante
Python
Estrellas
77.2k
Forks
35.9k
Métricas de merge de PR
Métricas de PR pendientes

Descripción

Every xml.dom.minidom document inherits DocumentLS, and most of it raises NotImplementedError:

>>> doc.load("x")
NotImplementedError: haven't written this yet
>>> doc.loadXML("<a/>")
NotImplementedError: haven't written this yet
>>> doc.abort()
NotImplementedError: haven't figured out what this means yet
>>> minidom.getDOMImplementation().createDOMWriter()
NotImplementedError: the writer interface hasn't been written yet!

Only saveXML(), createDOMBuilder() and createDOMInputSource() work. DocumentLS also defines _get_async() and _set_async(), where the setter should reject asynchronous loading, but they are never made a property, so async_ is a plain class attribute and doc.async_ = True silently succeeds.

The names come from a working draft. The final Recommendation defines LSParser, LSSerializer, LSInput, LSOutput, LSResourceResolver, LSParserFilter and DOMImplementationLS with createLSParser(), createLSSerializer(), createLSInput() and createLSOutput(), and defines no DocumentLS, DOMBuilder, DOMWriter, DOMEntityResolver or DOMInputSource at all.

Nothing of this is documented -- xml.dom.xmlbuilder has no documentation page, and DocumentLS, DOMImplementationLS, DOMBuilderFilter and Options are not in its __all__ -- and there is no successor in the WHATWG DOM Standard, where parsing and serialization are DOMParser and XMLSerializer in the HTML Standard.

So the question is whether to implement the missing parts, deprecate the whole feature, or leave it and document it as unimplemented. See also gh-152142 about DOMBuilderFilter.

Linked PRs
  • gh-156735

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza revisando xml.dom.minidom.DocumentLS y xml.dom.xmlbuilder; después, compara sus APIs con la DOM Level 3 Load and Save Recommendation enlazada. Consulta gh-156735 y gh-152142 antes de decidir si las interfaces afectadas deben implementarse, marcarse como obsoletas o documentarse como no implementadas; para darlo por terminado se requiere una dirección acordada y los cambios correspondientes en el proyecto.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
backend-api-design
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.