[pypy-issue] [issue827] import xml.etree.cElementTree fails

Josh Ayers tracker at bugs.pypy.org
Sat Aug 27 05:37:16 CEST 2011

Josh Ayers <josh.ayers at gmail.com> added the comment:

I think the two APIs are identical.  The unit tests for cElementTree use the
same tests as the Python version.  Also, in the CPython documentation, there is
no separate documentation for the Python and C versions like there is for
StringIO and Pickle.  The latter two packages have some differences between the
C and Python versions, and it's noted in the docs.

Currently under PyPy, the tests for cElementTree fail because of the import
error noted below.  The test file is lib-python\2.7\test\test_xml_etree_c.py.  

Getting the tests to run is a little more difficult than I indicated in my
original post.  Several methods that aren't included in ElementTree's __all__
attribute need to be imported.  Importing everything manually allows the tests
to pass.  See the attached file, which would replace cElementTree.py.

PyPy bug tracker <tracker at bugs.pypy.org>

More information about the pypy-issue mailing list