Comment 8 for bug 72227

Revision history for this message
Harald Meland (hmeland) wrote :

I am unable to reproduce this on Ubunty Jaunty, using either the bzr from the official Jaunty repository (1.13.1-1) or the current development version. I've tried the following procedure with both python 2.5.4-1ubuntu4 and 2.6.2-0ubuntu1:

hmeland@octarine:~$ mkdir /tmp/,72227/
hmeland@octarine:~$ cd /tmp/,72227/
hmeland@octarine:/tmp/,72227$ /usr/bin/python2.5 /usr/bin/bzr --no-plugins init
Created a standalone tree (format: pack-0.92)
hmeland@octarine:/tmp/,72227$ mkdir -p foo/codecs
hmeland@octarine:/tmp/,72227$ touch foo/codecs/__init__.py
hmeland@octarine:/tmp/,72227$ cd foo
hmeland@octarine:/tmp/,72227/foo$ /usr/bin/python2.5 /usr/bin/bzr --no-plugins add
adding foo
adding foo/codecs
adding foo/codecs/__init__.py

I've also tried a similar procedure using the standalone 1.16.1-3 installer on a virtual Windows XP box. I was unable to reproduce the bug there, too.

FWIW, the behaviour I'm seeing (i.e. not being able to reproduce the bug) seems to correspond well with Python's documentation (http://docs.python.org/library/sys.html#sys.path): sys.path[0] should only be an empty string when "the script directory is not available":

hmeland@octarine:/tmp/,72227/foo$ cat > test.py
#!/usr/bin/env python
import sys
import pprint
pprint.pprint(sys.path)
hmeland@octarine:/tmp/,72227/foo$ chmod +x test.py
hmeland@octarine:/tmp/,72227/foo$ ./test.py
['/tmp/,72227/foo',
 '/usr/lib/python2.6',
 '/usr/lib/python2.6/plat-linux2',
 '/usr/lib/python2.6/lib-tk',
 '/usr/lib/python2.6/lib-old',
 '/usr/lib/python2.6/lib-dynload',
 '/usr/lib/python2.6/dist-packages',
 '/usr/lib/python2.6/dist-packages/Numeric',
 '/usr/lib/python2.6/dist-packages/PIL',
 '/usr/lib/python2.6/dist-packages/gst-0.10',
 '/var/lib/python-support/python2.6',
 '/usr/lib/python2.6/dist-packages/gtk-2.0',
 '/var/lib/python-support/python2.6/gtk-2.0',
 '/usr/lib/python2.6/dist-packages/wx-2.8-gtk2-unicode',
 '/usr/local/lib/python2.6/dist-packages']

i.e. when I invoke a Python script on my system, there is no empty string element in sys.path.

Does anyone know how to reliably reproduce this bug?