This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kees
Recipients kees
Date 2013-08-16.08:31:02
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1376641863.98.0.614514582932.issue18753@psf.upfronthosting.co.za>
In-reply-to
Content
ElementTree.fromstring and cElementTree.fromstring fail on parsing
"<value>]]></value>", but do parse "<value>]]&gt;</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>]]&gt;</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>]]&gt;</value>").text
']]>'
>>>
History
Date User Action Args
2013-08-16 08:31:04keessetrecipients: + kees
2013-08-16 08:31:03keessetmessageid: <1376641863.98.0.614514582932.issue18753@psf.upfronthosting.co.za>
2013-08-16 08:31:03keeslinkissue18753 messages
2013-08-16 08:31:02keescreate