tim.peters at gmail.com
Tue Oct 11 00:42:26 CEST 2005
[Martin v. Löwis]
>> What happened to the CurrentVersion registry entry documented at
>> AFAICT, even the python15.wse file did not fill a value in this
>> entry (perhaps I'm misinterpreting the wse file, though).
>> So was this ever used? Why is it documented, and who documented it
>> (unfortunately, registry.html is not in cvs/subversion, either)?
> I believe I documented it many moons ago. I don't think CurrentVersion was
> ever implemented (or possibly was for a very short time before being
> removed). The "registered modules" concept was misguided and AFAIK is not
> used by anyone - IMO it should be deprecated (if not just removed!).
> Further, I believe the documentation in the file for PYTHONPATH is, as said
> in those docs, out of date, but that the comments in getpathp.c are correct.
It would be good to update that web page ;-)
The construction of PYTHONPATH differs across platforms, which isn't
good. Here's a key difference:
This is script.py:
from pprint import pprint
Suppose we run script.py while playground/ is the current directory.
I'm using 2.4.2 here, but doubt it matters much. No Python-related
envars are set.
Windows (and the PIL and pywin32 extensions are installed here):
When PC/getpathp.c says:
* Python always adds an empty entry at the start, which corresponds
to the current directory.
I'm not sure what it means. The directory containing the script we're
_running_ shows up first in sys.path there, while the _current_
directory shows up third.
Linux: the current directory doesn't show up at all:
[playground]$ ~/Python-2.4.2/python someother/script.py
I have no concrete suggestion, as any change to sys.path will break
something for someone. It's nevertheless not good that "current
directory on sys.path?" doesn't have the same answer across platforms
(unsure why, but I've been burned by that several times this year, but
never before this year -- maybe sys.path _used_ to contain the current
directory on Linux?).
More information about the Python-Dev