Message195315
ElementTree.fromstring and cElementTree.fromstring fail on parsing
"<value>]]></value>", but do parse "<value>]]></value>"
$ python
Python 2.7.3 (default, Apr 10 2013, 05:09:49)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import cElementTree as ET
>>> ET.fromstring("<value>]]></value>").text
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 124, in XML
cElementTree.ParseError: not well-formed (invalid token): line 1, column 9
>>> ET.fromstring("<value>]]></value>").text
']]>'
>>> from xml.etree import ElementTree as ET
>>> ET.fromstring("<value>]]></value>").text
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1301, in XML
parser.feed(text)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1643, in feed
self._raiseerror(v)
File "/usr/lib/python2.7/xml/etree/ElementTree.py", line 1507, in _raiseerror
raise err
xml.etree.ElementTree.ParseError: not well-formed (invalid token): line 1, column 9
>>> ET.fromstring("<value>]]></value>").text
']]>'
>>> |
|
Date |
User |
Action |
Args |
2013-08-16 08:31:04 | kees | set | recipients:
+ kees |
2013-08-16 08:31:03 | kees | set | messageid: <1376641863.98.0.614514582932.issue18753@psf.upfronthosting.co.za> |
2013-08-16 08:31:03 | kees | link | issue18753 messages |
2013-08-16 08:31:02 | kees | create | |
|