Problem using bzr on Python program

John Arbash Meinel john at
Mon Feb 12 15:05:19 GMT 2007

Hash: SHA1

Chris Seaton wrote:
> Actually I'm using
> Bazaar (bzr) 0.10.0
> Using python interpreter:
> /home/ugrads/coms2003/cs3951/linux/installed/bin/python2.5
> Using python standard library:
> /home/ugrads/coms2003/cs3951/linux/installed/lib/python2.5
> Using bzrlib:
> /home/ugrads/coms2003/cs3951/linux/installed/lib/python2.5/site-packages/bzrlib
> with
> Python 2.5 (r25:51908, Sep 26 2006, 14:51:52)
> on Linux.
> If it's a known bug is there a workaround?
> Thanks
> Chris Seaton

I haven't seen the bug on Linux, but the general case is when 'sys.path'
somehow starts to include '.' The old bug that Alexander is mentioning,
was a case where on Windows would end up including '', which
then gets translated through os.abspath() to whatever the current
working directory is.

The only difficulty is that we usually do what the path where the 'bzr'
script resides to be included (since this allows you to simply run out
of source without installing).

You might try something like

echo -n 'import sys\nprint sys.path\n'>

And then you can run that from different directories like:



cd ..
python test/

In both cases you should see that the "test" directory is in your path,
but in the second case the current working directory should not be.

- From there, it is just a matter of tracking down who is putting the cwd
into your path. One place to look is in lib/python2.5/

That file is pretty much always imported, and at the end it calls
'main()' which does some setup of python.

One thing you might try is to just put "print sys.path" before and after
the main() call. Which should help to see if that is the point where
things are getting setup improperly.

Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Mozilla -


More information about the bazaar mailing list