[New-bugs-announce] [issue3075] make minidom.toxml() encoding argument useful

Bill Janssen report at bugs.python.org
Tue Jun 10 20:12:04 CEST 2008


New submission from Bill Janssen <bill.janssen at gmail.com>:

Right now, the encoding argument added to
xml.dom.minidom.DOMObject.toxml() in Python 2.3 seems fairly useless. 
It has to be UTF-8.  But a one-line change to the implementation of
toprettyxml would make it useful; instead of the encoding error method
being "strict", make it "xmlcharrefreplace".  So change

    writer = codecs.lookup(encoding)[3](writer)

to

    writer = codecs.lookup(encoding)[3](writer, "xmlcharrefreplace")

----------
components: Library (Lib)
keywords: easy
messages: 67909
nosy: janssen
priority: normal
severity: normal
status: open
title: make minidom.toxml() encoding argument useful
versions: Python 2.6, Python 3.0

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3075>
_______________________________________


More information about the New-bugs-announce mailing list