ImportError: cannot import name error

Bug #1216412 reported by Peter Dyballa
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar Fast Import
New
Undecided
Unassigned

Bug Description

In order to become able to import hg or bzr repositories with git I was advised on the internet to install the bzr fastimport plugin (https://github.com/lelutin/git-remote-bzr). After fetching and installing the software I tried the selftest, which first failed, because the Python testtools was not installed. After its installation the selftest now really failed.

This is on Mac OS X 10.6.8 (Snow Leopard) with Python 2.7 installed via the MacPorts port manager. Bzr is:

bzr selftest fastimport
bzr: ERROR: exceptions.ImportError: cannot import name error

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/commands.py", line 1121, in run_bzr
    ret = run(*run_argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/commands.py", line 697, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/builtins.py", line 4197, in run
    result = tests.selftest(**selftest_kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/tests/__init__.py", line 3734, in selftest
    suite = test_suite(keep_only, starting_with)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/tests/__init__.py", line 4225, in test_suite
    plugin_suite = plugin.test_suite()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/plugin.py", line 555, in test_suite
    return self.module.test_suite()
  File "/Users/pete/.bazaar/plugins/fastimport/__init__.py", line 91, in test_suite
    return tests.test_suite()
  File "/Users/pete/.bazaar/plugins/fastimport/tests/__init__.py", line 35, in test_suite
    return loader.loadTestsFromModuleNames(module_names)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/tests/TestUtil.py", line 148, in loadTestsFromModuleNames
    result.addTests(self.loadTestsFromModuleName(name))
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/tests/TestUtil.py", line 153, in loadTestsFromModuleName
    module = pyutils.get_named_object(name)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/bzrlib/pyutils.py", line 58, in get_named_object
    __import__(module_name, globals(), locals(), [])
  File "/Users/pete/.bazaar/plugins/fastimport/tests/test_generic_processor.py", line 29, in <module>
    from bzrlib.plugins.fastimport.processors import (
  File "/Users/pete/.bazaar/plugins/fastimport/processors/generic_processor.py", line 31, in <module>
    from bzrlib.plugins.fastimport import (
  File "/Users/pete/.bazaar/plugins/fastimport/branch_updater.py", line 22, in <module>
    from bzrlib.trace import error, note
ImportError: cannot import name error

bzr 2.6.0 on python 2.7.5 (Darwin-10.8.0-x86_64-i386-64bit)
arguments: ['/opt/local/bin/bzr', 'selftest', 'fastimport']
plugins: bash_completion[2.6.0], changelog_merge[2.6.0], fastimport[0.9.0dev],
    grep[2.6.0], launchpad[2.6.0], netrc_credential_store[2.6.0],
    news_merge[2.6.0], po_merge[2.6.0], weave_fmt[2.6.0]
encoding: 'utf-8', fsenc: 'utf-8', lang: 'de_DE.UTF-8'

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.
Exit 4

Revision history for this message
Vincent Ladeuil (vila) wrote :

error and note were deprecated in 2.1.0 and removed from trace.py in the 2.4 cycle.

At that point the their code was:

@deprecated_function(deprecated_in((2, 1, 0)))
def info(*args, **kwargs):
    """Deprecated: use trace.note instead."""
    note(*args, **kwargs)

@deprecated_function(deprecated_in((2, 1, 0)))
def log_error(*args, **kwargs):
    """Deprecated: use bzrlib.trace.show_error instead"""
    _bzr_logger.error(*args, **kwargs)

@deprecated_function(deprecated_in((2, 1, 0)))
def error(*args, **kwargs):
    """Deprecated: use bzrlib.trace.show_error instead"""
    _bzr_logger.error(*args, **kwargs)

So the plugin needs to be updated.

affects: bzr → bzr-fastimport
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.