bzr using cwd in pythonpath?

Jamie Wilkinson jaq at spacepants.org
Wed Nov 30 03:14:37 GMT 2005


I have a directory, that's not a bzr working tree (though the code in it has
since been moved into one) that looks like this:

plank% ls
,,undo-1/     fengshui.py~    rack.py~      rack2tex.py~     sourcefile.pyc
NOTES         parser.py       rack2ps.py    rackbuilder.py   sourceposition.py
TODO          parser.pyc      rack2ps.pyc   rackbuilder.pyc  sourceposition.pyc
ast.py        postscript.py   rack2ps.py~   rackbuilder.py~  token.py
ast.pyc       postscript.pyc  rack2svg.py   scanner.py       token.pyc
example.feng  rack.py         rack2svg.pyc  scanner.pyc      {arch}/
fengshui.py   rack.pyc        rack2tex.pyc  sourcefile.py

If I mistakenly run bzr within this directory, I get this traceback:

plank% bzr merge ../feng.bzr
Traceback (most recent call last):
  File "/home/jaq/src/bzr/bzr.dev/bzr", line 49, in ?
    import bzrlib.commands
  File "/home/jaq/src/bzr/bzr.dev/bzrlib/commands.py", line 33, in ?
    from inspect import getdoc
  File "/usr/lib/python2.4/inspect.py", line 31, in ?
    import sys, os, types, string, re, dis, imp, tokenize, linecache
  File "/usr/lib/python2.4/tokenize.py", line 38, in ?
    COMMENT = N_TOKENS
NameError: name 'N_TOKENS' is not defined

I don't get anything in ~/.bzr.log.

Is it possible that the files in the current directory are interfering with
bzr?  It looks that way, but having . in the PYTHONPATH seems like such a
bad idea that it's not possible that the bzr developers could have made that
mistate :)




More information about the bazaar mailing list