[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Eli Bendersky
Eli Bendersky added the comment: Fixed. Thanks. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset d965ff47cf94 by Eli Bendersky in branch '3.3': Issue #16913: Fix Element.itertext()'s handling of text with XML entities. http://hg.python.org/cpython/rev/d965ff47cf94 New changeset 9ab8632e7213 by Eli Bendersky in branch 'default': Issue #16913: Fi

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch for 3.3+. 2.7 and 3.2 are not affected. -- keywords: +patch stage: needs patch -> patch review versions: +Python 3.4 Added file: http://bugs.python.org/file28666/etree_itertext.patch ___ Python track

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Frank
Frank added the comment: Scratch that, it happens whenever there are XML entities (<, " and friends) that are appearing the text as you pointed out. -- ___ Python tracker ___ __

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Frank
Frank added the comment: It happens whenever the method is called, regardless of input. I'm using HTML that has been tidied first with HTML entities (if any) converted to unicode values. -- ___ Python tracker ___

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I found such example. It happens when the data contains XML entity. >>> ET.tostring(ET.XML('a&'), method='text', >>> encoding='unicode') Traceback (most recent call last): File "", line 1, in File "/home/serhiy/py/cpython/Lib/xml/etree/ElementTree.py", l

[issue16913] ElementTree tostring error when method='text'

2013-01-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Can you please provide an example of data for which the tostring method fails? I can't reproduce this on simple data. >>> import xml.etree.ElementTree as ET >>> ET.tostring(ET.XML('qwerty'), method='text', >>> encoding='unicode') 'qwerty' -- nosy: +

[issue16913] ElementTree tostring error when method='text'

2013-01-09 Thread Ezio Melotti
Changes by Ezio Melotti : -- keywords: +3.3regression nosy: +eli.bendersky, ezio.melotti stage: -> needs patch type: -> behavior ___ Python tracker ___

[issue16913] ElementTree tostring error when method='text'

2013-01-09 Thread Frank
New submission from Frank: Since upgrading to python 3.3 the tostring method fails when the output method is requested as text. Code like this: with open(fp, mode='rt') as f: data = f.read() tree, idmap = ET.XMLID(data) print(ET.tostring(tree, method='text', encoding='unicode')) Generates