xml.etree.ElementTree.ParseError not supported in Python 2.6

Bug #893757 reported by Lorin Hochstein on 2011-11-22
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Soren Hansen

Bug Description

Unit tests fail in Python 2.6.5. Example:

Traceback (most recent call last):
 File "nova/tests/test_virt_drivers.py", line 437, in setUp
   import fakelibvirt
 File "nova/tests/fakelibvirt.py", line 18, in <module>
   from xml.etree.ElementTree import ParseError
ImportError: cannot import name ParseError

It looks like some code is using some ElementTree functionality that isn't in Python 2.6.x. Here's Python 2.6.6 on RHEL 6.1:

$ python
Python 2.6.6 (r266:84292, Apr 11 2011, 15:50:32)
[GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from xml.etree.ElementTree import ParseError
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: cannot import name ParseError

Lorin Hochstein (lorinh) on 2011-11-22
summary: - xml.etree.ElementTree.ParseError not support in Python 2.6
+ xml.etree.ElementTree.ParseError not supported in Python 2.6

Reviewed: https://review.openstack.org/1854
Committed: http://github.com/openstack/nova/commit/b6ae26ba279246d1b9e32b8665316a47847147ce
Submitter: Jenkins
Branch: master

 status fixcommitted

commit b6ae26ba279246d1b9e32b8665316a47847147ce
Author: Soren Hansen <email address hidden>
Date: Tue Nov 22 22:53:22 2011 +0100

    Make fakelibvirt python2.6 compatible

    Fix bug #893757. In Python 2.6 xml.etree.ElementTree.fromstring
    raises xml.parsers.expat.ExpatError instead of
    xml.etree.ElementTree.ParseError when faced with invalid xml.
    Adjust accordingly.

    Change-Id: I1e4ae532e001618bded2b60e554915e5d6f7e038

Changed in nova:
status: New → Fix Committed
Thierry Carrez (ttx) on 2011-12-14
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Mark McLoughlin (markmc) on 2012-04-03
Changed in nova:
assignee: nobody → Soren Hansen (soren)
Thierry Carrez (ttx) on 2012-04-05
Changed in nova:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers