[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-15 Thread Eli Bendersky
Changes by Eli Bendersky : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ __

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 7bdf5c96fdc0 by Eli Bendersky in branch 'default': Closes Issue #14246: _elementtree parser will now handle io.StringIO http://hg.python.org/cpython/rev/7bdf5c96fdc0 -- nosy: +python-dev ___ Python track

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-13 Thread Eli Bendersky
Eli Bendersky added the comment: Stefan, Thanks a lot for taking the time to review the patch. As you correctly say, the current pathch's goal is just to align with existing behavior in the Python implementation of ET. I understand the problem you are describing, but at least it's not a regr

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-13 Thread Stefan Behnel
Stefan Behnel added the comment: FWIW, lxml also has support for parsing Unicode strings. It doesn't encode the input, however, but parses straight from the underlying buffer (after detecting the buffer layout etc. at module init time - and yes, I still haven't fixed this up for PEP393). The

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-12 Thread Eli Bendersky
Eli Bendersky added the comment: Attaching a patch that fixes the problem and adds a test. xmlparser_parse from _elementtree will now be able to handle Unicode, encoding it to bytes with UTF-8, parallel to the way it's done in pyexpat. I would appreciate a review for the patch. -- ke

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Eli Bendersky
Eli Bendersky added the comment: Both the Python ET and _elementtree use expat, but reach its parsing function in a different path when given a file-like object (StringIO, BytesIO). Python ET reads the stream itself and passes the data to pyexpat's Parse method, which uses PyArg_ParseTuple to

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Eli Bendersky
Changes by Eli Bendersky : -- assignee: -> eli.bendersky keywords: +3.2regression stage: -> needs patch ___ Python tracker ___ ___ P

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Phil Thompson
Phil Thompson added the comment: This variation of your test doesn't... --- import io from xml.etree.ElementTree import parse stream = io.StringIO() stream.write(''' ''') stream.seek(0) parsed = parse(stream) print(parsed)

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Eli Bendersky
Eli Bendersky added the comment: Note that this code works fine: --- tree = ET.ElementTree() stream = io.BytesIO() stream.write(b''' ''') stream.seek(0) tree.parse(stream) print(tree.getroot()) --- -- _

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Eli Bendersky
Eli Bendersky added the comment: Hi Phil, Could you please post the problematic code snippet that runs with 3.2 but not 3.3? Thanks in advance -- ___ Python tracker ___ _

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Martin v . Löwis
Changes by Martin v. Löwis : -- nosy: +eli.bendersky ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mai

[issue14246] Accelerated ETree XMLParser cannot handle io.StringIO

2012-03-10 Thread Phil Thompson
New submission from Phil Thompson : The old unaccelerated ETree XMLParser accepts input from a io.StringIO, but the accelerated version does not. Any code that relies on this is broken by Python v3.3. -- components: XML messages: 155301 nosy: philthompson10 priority: normal severity: n