bzr doesn't work in parent directories of python packages with certain names
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
New
|
Undecided
|
Unassigned |
Bug Description
It shouldn't be surprising that I use bzr a lot on python projects. However, bzr becomes unusable as soon as some sub-package of my project has a name that bzr doesn't like.
For example, say I have my own "codecs" python subpackage:
$ mkdir -p src/libmyapp/
$ cd src/libmyapp
$ touch codecs/__init__.py
$ bzr add
Traceback (most recent call last):
File "/usr/bin/bzr", line 79, in <module>
import locale
File "/usr/lib/
import sys, encodings, encodings.aliases
File "/usr/lib/
from encodings import aliases
ImportError: cannot import name aliases
Or if the package is named bisect instead:
cannot import name bisect_right
Unable to load plugin 'search' from '/usr/lib/
cannot import name bisect_right
Unable to load plugin 'loom' from '/usr/lib/
cannot import name bisect_right
Unable to load plugin 'launchpad' from '/usr/lib/
cannot import name bisect_right
Unable to load plugin 'cvsps_import' from '/usr/lib/
bzr: ERROR: exceptions.
Traceback (most recent call last):
File "/usr/lib/
return run_bzr(argv)
File "/usr/lib/
ret = run(*run_argv)
File "/usr/lib/
return self.run(
File "/usr/lib/
tree = WorkingTree.
File "/usr/lib/
control, relpath = bzrdir.
File "/usr/lib/
return BzrDir.
File "/usr/lib/
result = BzrDir.
File "/usr/lib/
redirected)
File "/usr/lib/
return obj(*args, **kwargs)
File "/usr/lib/
return action(transport)
File "/usr/lib/
transport, _server_
File "/usr/lib/
return format.
File "/usr/lib/
format = klass()
File "/usr/lib/
from bzrlib.
File "/usr/lib/
from bzrlib.branch import BranchCheckResult
File "/usr/lib/
__format7 = BzrBranchFormat7()
File "/usr/lib/
RepositoryF
File "/usr/lib/
obj = _replace()
File "/usr/lib/
obj = factory(self, scope, name)
File "/usr/lib/
module = __import_
File "/usr/lib/
from bzrlib.btree_index import (
File "/usr/lib/
from bisect import bisect_right
ImportError: cannot import name bisect_right
bzr 1.9 on python 2.5.2 (linux2)
arguments: ['/usr/bin/bzr', 'add']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
bzrtools /usr/lib/
gtk /usr/lib/
rebase /usr/lib/
stats /usr/lib/
svn /usr/lib/
upload /usr/lib/
*** Bazaar has encountered an internal error.
Please report a bug at https:/
including this traceback, and a description of what you
were doing when the error occurred.
This happens with LOTS of names, and depending on what the conflict is it may or may not show up except with certain commands, etc. It's really annoying and makes bzr feel very fragile.
I realize this is happening because bzr is implemented in python, and so it's trying to import the subpackages in the current directory. The workaround is to move up or down in the heirarchy and run bzr command from there. But this is really lame, because as a bzr user, bzr should act just like svn or git, and be able to version any times of files, and not have implementation details (i.e. bzr written in python) screw up using it. The worst irony is that if I wasn't writing python programs, I wouldn't run into this.
This is a duplicate, but your use case makes it really painful :-/