Weird Panda3d 1.4.1 behavior on Windows Vista

Hi,

I Just found this strange behavior in Panda 1.4.1 running on Vista:
On my machine, the current working directory is not added to the system path.

So when I do

import sys
print sys.path

it doesn’t list ‘’ in the path list. (It might seem odd at first, but python treats ‘’ as the local path, not e.g. ‘.’ or so…) On Windows XP it does have ‘’ in the path list. I tried this both with the “official” 1.4.1 release and with my own built, which I built from a source somhwere between 1.4.0 and 1.4.1. and the problem occurs in both versions.
When I use the exactly same version of panda on XP, it has the current dir in the path.

The missing local directory on the path bytes me when I want to import local modules such as:

from local.engine import CoolFeature

This is not a huge issue, because I can add the local dir to the path, but it is very odd.

ANY idea what’s causing this?

Cheers,

Erik

I don’t know.

I’m pretty sure that panda doesn’t touch the path. Have you tried it using a stock copy of python?

Hmm… I need to investigate this some more.
However, it doesn’t seem to be a panda problem, but rather a general vista/python thing.

Here’s what I found out so far:

  1. ppython.exe behaves exactly as any other python (= pre-built, downloaded versions, such as 2.5.1 or so)
  2. the missing `` in the sys.path list only occurs if I invoke ppython on a .py file thats not in the local dir, a’la ppython game/test/demo.py.

However, in the case of 2), ‘’ is replaced with the working directory, which is the right thing anyway, and exactly how things are handled on xp as well.

Why python/ppython then fails to import relative modules, I still need to investigte.

Erik

I should mention that “ppython” is a historical anachronism. We just use “python” now, in keeping with the fact that the copy of python included with panda is just a plain-vanilla standard copy of python.