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

Bug #893757 reported by Lorin Hochstein
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
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)
summary: - xml.etree.ElementTree.ParseError not support in Python 2.6
+ xml.etree.ElementTree.ParseError not supported in Python 2.6
Revision history for this message
Openstack Gerrit (openstack-gerrit) wrote : Fix merged to nova (master)

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

 status fixcommitted
 done

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)
Changed in nova:
milestone: none → essex-2
status: Fix Committed → Fix Released
Mark McLoughlin (markmc)
Changed in nova:
assignee: nobody → Soren Hansen (soren)
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-2 → 2012.1
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.