strange elementtree error

Viktor Nagy viktor.nagy at gmail.com
Fri Feb 6 10:39:48 GMT 2009


Hi,

I have a web interface to create new repositories, but I check them out with
the usual command line bzr. The strange thing is that after an apache reload
either the web interface or the command line checkout works, and I can redo
it any time I want, but I can't mix them. E.g

# /etc/init.d/apache2 reload
-> start a project on the web - ok
-> check it out with bzr+http - fails
-> create another project - ok
# /etc/init.d/apache2 reload
-> check out the previously created projects - ok
-> create another project - fails

The error is always the same:
AttributeError at /usr/lib/python2.5/site-packages/bzrlib/xml_serializer.py
in <module>, line 146 'module' object has no attribute 'ElementTree'

I've checked what is elementtree when xml_serializer is called by adding two
logging lines at the beginning of the file. They log the "signature" of
elementtree and the elementtree.ElementTree variables

* web interface after restart:
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
ElementTree<module 'xml.etree.ElementTree' from
'/usr/lib/python2.5/xml/etree/ElementTree.pyc'>

* a new create writes nothing, xml_serializer is not called

* a failed checkout
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
 (the failure occurs at the second log line in this case)

* a successful checkout, after the restart
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
ElementTree<module 'xml.etree.ElementTree' from
'/usr/lib/python2.5/xml/etree/ElementTree.pyc'>

* another checkout does nothing

* a failed create from the web
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>
elementtree<module 'xml.etree' from
'/usr/lib/python2.5/xml/etree/__init__.pyc'>

and this was just one call!

this is "my" code that raises the exception above
def createRepo(path, mask=0750):
    '''
    Run "bzr init-repo --no-working-tree" at the given location
    '''
    repository_format = bzrdir.format_registry.make_bzrdir('pack-0.92')
    os.mkdir(path, mask)
    transport = LocalTransport('file://' + path)
    newdir = repository_format.initialize_on_transport(transport)
    try:
        repo = newdir.create_repository(shared=True)
        repo.set_make_working_trees(False)
    except:
        raise
    else:
        return repo

Any ideas how to overcome this problem?

Viktor
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://lists.ubuntu.com/archives/bazaar/attachments/20090206/c28db5ec/attachment.htm 


More information about the bazaar mailing list