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

Bug #1206256 reported by Brad Pokorny
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
Undecided
Brad Pokorny

Bug Description

Python 2.6 unit tests fail when and error path using xml.etree.ElementTree.ParseError is exercised. This is similar to nova bug #893757.

2013-07-29 18:36:47.528 | Traceback (most recent call last):
2013-07-29 18:36:47.528 | File "/home/jenkins/workspace/gate-ceilometer-python26/tests/api/v2/test_app.py", line 122, in test_xml_parsable_error_middleware_404
2013-07-29 18:36:47.528 | ,application/xml"}
2013-07-29 18:36:47.528 | File "/home/jenkins/workspace/gate-ceilometer-python26/ceilometer/tests/api.py", line 168, in get_json
2013-07-29 18:36:47.528 | expect_errors=expect_errors)
2013-07-29 18:36:47.528 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/webtest/app.py", line 199, in get
2013-07-29 18:36:47.528 | expect_errors=expect_errors)
2013-07-29 18:36:47.528 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/webtest/app.py", line 467, in do_request
2013-07-29 18:36:47.528 | res = req.get_response(app, catch_exc_info=True)
2013-07-29 18:36:47.529 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/webob/request.py", line 1292, in send
2013-07-29 18:36:47.529 | application, catch_exc_info=True)
2013-07-29 18:36:47.529 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/webob/request.py", line 1260, in call_application
2013-07-29 18:36:47.529 | app_iter = application(self.environ, start_response)
2013-07-29 18:36:47.529 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/webtest/lint.py", line 198, in lint_app
2013-07-29 18:36:47.529 | iterator = application(environ, start_response_wrapper)
2013-07-29 18:36:47.529 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/pecan/middleware/recursive.py", line 56, in __call__
2013-07-29 18:36:47.529 | return self.application(environ, start_response)
2013-07-29 18:36:47.529 | File "/home/jenkins/workspace/gate-ceilometer-python26/ceilometer/api/middleware.py", line 131, in __call__
2013-07-29 18:36:47.529 | except et.ElementTree.ParseError as err:
2013-07-29 18:36:47.529 | AttributeError: 'module' object has no attribute 'ParseError'

Brad Pokorny (bpokorny)
Changed in ceilometer:
assignee: nobody → Brad Pokorny (bpokorny)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/39155

Changed in ceilometer:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/39155
Committed: http://github.com/openstack/ceilometer/commit/c7936656c06625f27a99ae6cd402ea00d4712c78
Submitter: Jenkins
Branch: master

commit c7936656c06625f27a99ae6cd402ea00d4712c78
Author: Brad Pokorny <email address hidden>
Date: Mon Jul 29 20:42:17 2013 +0000

    Make middleware.py Python 2.6 compatible

    Fixes bug 1206256

    In Python 2.6 xml.etree.ElementTree.fromstring raises
    xml.parsers.expat.ExpatError instead of
    xml.etree.ElementTree.ParseError when faced with invalid xml.
    This change catches an import error and uses ExpatError instead of
    ParseError.

    Change-Id: I8ab41328c8eeacc28f4e01d730c73ff251df4a25

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-3 → 2013.2
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.