PyCrust's shell mucks with sys.path...

This line:
  shellWin = shell.Shell(splitter, -1,
    introText="Welcome to PyCrust %s" % version.VERSION)

(at least on MSW) inserts a '.' in the first position of sys.path.
Combined with the fact that wx.FileDialog() changes the current
directory, this screws up my program.

Is there any reason that the PyCrust shell needs the current working
directory to be the first, or any, element of sys.path? Note that my
sys.path already has a '' at the beginning and that all modules are
able to import modules in the same directory with a simple "import
foo"...

My import is:
  from wxPython.lib.PyCrust import shell, version, filling

Environment is wx2407, Python 222, Windows 2000 Pro.

···

--
Chuck
http://ChuckEsterbrook.com

Chuck Esterbrook <ChuckEsterbrook@yahoo.com> writes:

This line:
  shellWin = shell.Shell(splitter, -1,
    introText="Welcome to PyCrust %s" % version.VERSION)

(at least on MSW) inserts a '.' in the first position of sys.path.
Combined with the fact that wx.FileDialog() changes the current
directory, this screws up my program.

Is there any reason that the PyCrust shell needs the current working
directory to be the first, or any, element of sys.path? Note that my
sys.path already has a '' at the beginning and that all modules are
able to import modules in the same directory with a simple "import
foo"...

I'm pretty sure I did it because IDLE did it. At this point I don't
see any reason for it to be there. So feel free to comment out line
195 of shell.py:

## sys.path.insert(0, os.curdir)

It will be removed in the next release.

···

--
Patrick K. O'Brien
Orbtech http://www.orbtech.com/web/pobrien
-----------------------------------------------
"Your source for Python programming expertise."
-----------------------------------------------