Do 2.2 and 2.1.1coexist well?

Tim Peters tim.one at home.com
Mon Dec 3 14:32:37 EST 2001


[David C. Ullrich, about Python on Windows]
> I've been meaning to ask about this, didn't want to sound stupid:

I've meaning to answer this, but likewise didn't want to sound stupid.

> ...
> File associations is no problem - people who enjoy such things can
> have great fun arranging trick ways to send a .py file to various
> different python.exe's (adding various shell commands, and/or
> associating .py with something that reads the first line of the
> file for the name of the executable as in UNIX...)
> ...
> But Python itself seems to use the registry, for example it appears
> that that's where it reads PYTHONPATH from.

It's complicated.  You can read the comments at the start of PC\getpathp.c,
and I know of know way to summarize that usefully.  In fact, Python on
Windows normally never reads the registry for anything, not even for
PYTHONPATH.  You can verify that by changing the PYTHONPATH in your
registry, and then noting that sys.path doesn't change as a result.  The
PYTHONPATH in the registry is a backup in case all other attempts to locate
Python's home directory fail (which can happen if, e.g., Python components
are invoked via COM by some other app).  (OTOH, it could be the rules have
changed since the ancient version of Python you're still torturing yourself
with <wink>.)

> So sissys like me get nervous installing a new version if we hope to
> keep the old one... Right now it looks like all the Python stuff is
> under HKEY_LOCAL_MACHINE/Software/Python/PythonCore/1.5. Presumably
> if a person installed 2.x that would appear under PythonCore/2.x
> without making any changes to PythonCore/1.5?

Yes, although, as above, these registry entries normally aren't used.





More information about the Python-list mailing list