main
main copied to clipboard
Implement _elementtree module
Not much documentation on this module. It's used by the 'xml' stdlib package.
Work Item Details
Original CodePlex Issue: Issue 21407 Status: Active Reason Closed: Unassigned Assigned to: Unassigned Reported on: Feb 25, 2009 at 7:16 PM Reported by: dfugate Updated on: Feb 22, 2013 at 2:13 AM Updated by: rivimey
On 2010-11-12 01:21:46 UTC, pekkaklarck commented:
IronPython 2.6.1 already has some code under xml.etree. Unfortunately even this fails:
IronPython 2.6.1 (2.6.10920.0) on .NET 4.0.30319.1 Type "help", "copyright", "credits" or "license" for more information.
from StringIO import StringIO
from xml.etree import ElementTree as ET
ET.parse(StringIO('
It seems SimpleXMLTreeBuilder is not included in xml.etree so basically using the provided ElementTree implementation isn't possible. I just tested that elementtree 1.2.7 preview release [1], which should have better IronPython support than 1.2.6, works well in my project. Does something prevent including it into IronPython?
[1] http://effbot.org/downloads/#elementtree
On 2010-12-16 17:01:06 UTC, af001 commented:
The elementtree module is a core component for xml handling in python. It is essential for it to work!
Seo Sanghyeon appears to have written pyexpat/ElementTree for IronPython (a pyexpat emulation for IronPython which lets you use the standard ElementTree module on that platform). At least this should be included into the distribution.
The current ironpython distribution (2.6.1) has the unfortunate approach of providing a module for input that breaks immediately.
On 2011-10-10 21:14:19 UTC, pekkaklarck commented:
I'm surprised this issue is considered low priority because not having a working ElementTree implementation in IronPython is a big blocker for many Python programs. I know this is an open source project with limited resources but in this case there already is a working implementation that ought to be easy to take into use (see my nearly a year old comment above about ET 1.2.7).
What's worse than not having ET is having an implementation that can be imported but not used. This means that even if you install a working ET, any code that uses the "standard" way to conditionally import ET (see e.g. http://lxml.de/tutorial.html) still doesn't work because you end up getting a broken ET implementation anyway.
On 2011-10-11 23:51:13 UTC, jdhardy commented:
This issue is low priority because it refers to the _elementtree C accelerator module. To make ET work, IronPython needs a pyexpat implmentation ([workitem:20023]) or, as you pointed last year (sorry!), an upgrade to ET.
On 2011-10-12 03:28:31 UTC, pekkaklarck commented:
Submitted issue #31579 about changing ET implementation to IPY compatible version.