Comment 2 for bug 254278

Revision history for this message
ViktorNagy (viktor-nagy) wrote :

Sorry for not replying before, but I was using ssh instead, so there was no error.

Now I am running a small script served through django and mod_wsgi, and I get the same error. If I run the script straight then everything is fine. I've printed sys.path just before calling the bzrlib functions, and sys.path is the same in both cases. The script and the two diffs are provided below.

The script is:
import bzrlib.bzrdir
import os, sys
from bzrlib.builtins import cmd_init_repository
from tempfile import mkstemp

def createRepo(url, mask=0750):
    '''
    Run "bzr init-repo --no-working-tree" at the given location
    '''
    open('/home/coosci/dev-repos/log/pythonpath-3.py', 'w').write(str(sys.path))
    repository_format = bzrlib.bzrdir.format_registry.make_bzrdir('pack-0.92')
    bzr_init_repo = cmd_init_repository()
    bzr_init_repo.outf = open(mkstemp()[1], 'w')

    os.mkdir(url, mask)
    bzr_init_repo.run(url, format=repository_format, no_trees=True)

and the two sys.paths are
$ diff pythongpath-2.py pythonpath-3.py
1c1
< ['/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5', '/home/coosci/dev-repos/repos/webapp/main', '/home/coosci/dev-repos/repos/webapp/main']
\ No newline at end of file
---
> ['/home/coosci/dev-repos/tmp', '/usr/lib/python25.zip', '/usr/lib/python2.5', '/usr/lib/python2.5/plat-linux2', '/usr/lib/python2.5/lib-tk', '/usr/lib/python2.5/lib-dynload', '/usr/local/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages', '/usr/lib/python2.5/site-packages/PIL', '/var/lib/python-support/python2.5', '/home/coosci/dev-repos/repos/webapp/main/']
\ No newline at end of file

any ideas what might be the problem?
I am running bzr 1.8