AttributeError: 'module' object has no attribute 'ElementTree'

Bug #772285 reported by Radomir Dopieralski
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
Undecided
Unassigned

Bug Description

[Thu Apr 28 12:38:43 2011] [error] [client 83.238.74.161] File ".../bzrlib/xml_serializer.py", line 146, in <module>
[Thu Apr 28 12:38:43 2011] [error] [client 83.238.74.161] elementtree.ElementTree._escape_attrib = _escape_attrib
[Thu Apr 28 12:38:43 2011] [error] [client 83.238.74.161] AttributeError: 'module' object has no attribute 'ElementTree'

The problem is that depending on where elementtree was imported from, (xml.etree or elementteree, etc.) the elementtree.ElementTree will be imported or not. Changing the offending line to:

ElementTree._escape_attrib = _escape_attrib

gets rid of this particular problem, but I will not even comment why bzrlib is monkey-pacthing ElementTree and leaving it like that for all other code to fumble on it.

Revision history for this message
John A Meinel (jameinel) wrote :

Old bug, already fixed.

Changed in bzr:
status: New → Fix Released
Revision history for this message
Vincent Ladeuil (vila) wrote :

What OS/bzr/plugins versions are you using ?

Bugs has been fixed in this area in recent versions of bzr.

Changed in bzr:
status: Fix Released → Incomplete
Revision history for this message
Vincent Ladeuil (vila) wrote :

bah, concurrent updates :-/

Changed in bzr:
status: Incomplete → Fix Released
Revision history for this message
Radomir Dopieralski (ubuntu-sheep) wrote :

I verified this bug in bzr_2.1.2-1 (squeeze), bzr_1.5-1.1 (lenny) and bzr_2.0.3-1 (lenny-backports) in Debian.

Revision history for this message
Martin Packman (gz) wrote :

The existing bug has details of which versions of bzr contain the fix, 2.1.3 or later is needed.

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.