[Pythonmac-SIG] RE: [Python-Dev] Added platform-specific directories to sys.path

Tim Peters tim.one@comcast.net
Sun, 21 Jul 2002 17:04:02 -0400


[Martin v. Loewis]
> If that is the platform convention, I see no problem following
> it. Windows already does things differently from Unix, by using the
> registry to compute sys.path.

FYI, this is mostly a myth.  In normal operation for most people, Python
never gets any info out of the Windows registry.  The Python path in the
registry is consulted only in unusual situations, when the Python library
can't be found under the directory of the executable that called the
sys.path-setting code.  This can happen when, e.g., Python is embedded in
some other app.

The process is quite involved; the comment block at the top of PC/getpathp.c
is a good summary.  When reading it, note that there normally aren't any
"application paths" in the registry; e.g., the PLabs Windows installer
doesn't create any such beast.