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":
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/ octarine: /tmp/,72227$ /usr/bin/python2.5 /usr/bin/bzr --no-plugins init octarine: /tmp/,72227$ mkdir -p foo/codecs octarine: /tmp/,72227$ touch foo/codecs/ __init_ _.py octarine: /tmp/,72227$ cd foo octarine: /tmp/,72227/ foo$ /usr/bin/python2.5 /usr/bin/bzr --no-plugins add __init_ _.py
hmeland@octarine:~$ cd /tmp/,72227/
hmeland@
Created a standalone tree (format: pack-0.92)
hmeland@
hmeland@
hmeland@
hmeland@
adding foo
adding foo/codecs
adding foo/codecs/
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 pprint( sys.path) octarine: /tmp/,72227/ foo$ chmod +x test.py octarine: /tmp/,72227/ foo$ ./test.py lib/python2. 6', lib/python2. 6/plat- linux2' , lib/python2. 6/lib-tk' , lib/python2. 6/lib-old' , lib/python2. 6/lib-dynload' , lib/python2. 6/dist- packages' , lib/python2. 6/dist- packages/ Numeric' , lib/python2. 6/dist- packages/ PIL', lib/python2. 6/dist- packages/ gst-0.10' , lib/python- support/ python2. 6', lib/python2. 6/dist- packages/ gtk-2.0' , lib/python- support/ python2. 6/gtk-2. 0', lib/python2. 6/dist- packages/ wx-2.8- gtk2-unicode' , local/lib/ python2. 6/dist- packages' ]
#!/usr/bin/env python
import sys
import pprint
pprint.
hmeland@
hmeland@
['/tmp/,72227/foo',
'/usr/
'/usr/
'/usr/
'/usr/
'/usr/
'/usr/
'/usr/
'/usr/
'/usr/
'/var/
'/usr/
'/var/
'/usr/
'/usr/
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?