Comment 2 for bug 939386

Revision history for this message
justinsb (justin-fathomdb) wrote :

Vishy and I discussed this on IRC.

It's down to a bug in MiniDom, and affects all XML output.
Any string that outputs characters < 32 should really be escaped. Minidom doesn't do this: http://bugs.python.org/issue5752
I don't believe this has any e.g. security consequences other than the fact that we produce invalid XML. i.e. this isn't as bad as escape in HTML.
We probably want to move to lxml anyway. This may fix the problem for free.
It doesn't seem like a good idea to mess with all XML output at this stage.
Console output is particularly problematic because ANSI sequences start with 0x1B.
The patch therefore masks the problem for console-output (only)
Personally, I don't mind if the patch goes in or not; I can easily switch between using JSON and using XML in my binding.
In Folsom, we should fix this properly (with lxml or otherwise)