[issue5752] xml.dom.minidom does not escape newline characters within attribute values

Daniel Diniz report at bugs.python.org
Tue May 12 05:29:31 CEST 2009


Daniel Diniz <ajaksu at gmail.com> added the comment:

Francesco,
Your patch still doesn't allow one to add a multiline attribute values
as Tomalak describes:
"The catch: This leads to an actual data loss if I *wanted* to store
newline characters in an attribute -- unless the newline characters are
properly encoded. Encoding the newline characters is also valid and
conforms to the spec, so the DOM implementation should do it."

I'm not sure whether the proposed behavior is correct or desirable. Even
if it is correct, it might introduce backwards incompatible changes in
behavior.

Here's a test case for trunk.

----------
nosy: +ajaksu2
Added file: http://bugs.python.org/file13966/test_multiline_roundtrip.diff

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


More information about the Python-bugs-list mailing list