Skip to content

ElementTree.iterparse not implemented #370

Closed

Description

@pekkaklarck

Our project needs ElementTree.iterparse to parse large XML files memory efficiently. Unfortunately it is not implemented in IronPython:

IronPython 2.7.8 (2.7.8.0) on .NET 4.0.30319.42000 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree import ElementTree as ET
>>> from StringIO import StringIO
>>> ET.iterparse(StringIO('<root/>'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Program Files\IronPython 2.7\Lib\xml\etree\ElementTree.py", line 1198, in iterparse
NotImplementedError: iterparse is not supported on IronPython. (CP #31923)
>>>

We have instructed our users to install ElementTree 1.2.7 preview release from 2007 and it seems to work fine, but having such an extra dependency that cannot even be pip-installed is highly annoying. Incorporating the fixes from the aforementioned ElementTree version into IronPython itself would be great.

Activity

  1. self-assigned this
    on May 8, 2018
  2. slide commented on Jun 8, 2018

    @slide
    Contributor

    Do you have a test XML I could use to test a minimal implementation of pyexpat in IronPython?

  3. added this to the 2.7.9 milestone on Jul 11, 2018
  4. added a commit that references this issue on Aug 2, 2018
    c303163
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions