[New-bugs-announce] [issue24197] minidom parses comments wrongly

Paweł report at bugs.python.org
Fri May 15 00:09:14 CEST 2015

New submission from Paweł:

from xml.dom import minidom

html = """<html>
    <!-- <img src="/images/obraz--super.jpg"/> -->


Traceback (most recent call last):
  File "minidom.py", line 10, in <module>
  File "/usr/lib/python2.7/xml/dom/minidom.py", line 1928, in parseString
    return expatbuilder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 940, in parseString
    return builder.parseString(string)
  File "/usr/lib/python2.7/xml/dom/expatbuilder.py", line 223, in parseString
    parser.Parse(string, True)
xml.parsers.expat.ExpatError: not well-formed (invalid token): line 3, column 34

Tested versions:
2.7.6, 2.7.3

-- between obraz and super;

components: XML
messages: 243222
nosy: Wanat
priority: normal
severity: normal
status: open
title: minidom parses comments wrongly
type: crash
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list