Win32 Binary-only for 2.3.x?

Trent Mick trentm at ActiveState.com
Mon Jan 9 12:49:18 EST 2006


[Fuzzyman wrote]
> Out of interest, doesn't the Python binary use the registry (and
> environment variables) for building sys.path ?

Yes, good point...

> 
> Won't you still have conflicting path issues if you use an alternative
> binary with an existing 'normal' install ?

...but it is possible to effectively disable the use of the registry by
a given pythonXY.dll -- if you know how to edit the String Table of the
DLL. Basically there is a string entry in that table that is used as
part of the registry path for registry usage.

Here is how I do it:
- open MS Visual C++ 6 (I'm sure you can do all this with VS.NET, I
  just haven't done it.)
- Ctrl+O for the open file dialog
    - Files of type: Executable files (.exe;.dll;.ocx)
    - Open as:       Resources
    - browse to and open pythonXY.dll
- In the string table there is an entry with Value=1000 and Caption=X.Y
  (i.e. "2.3" for python23.dll, "2.4" for python24.dll, etc.). That
  "X.Y" string is what determines that part of the registry lookup path
  for:
    HKLM/Software/Python/PythonCore/X.Y/PythonPath
- You could change the "Caption" value to "FuzzyWuzzyWuzzaBear" to
  effectively disable usage of the registry for sys.path building by
  that pythonXY.dll.

Cheers,
Trent


-- 
Trent Mick
trentm at activestate.com



More information about the Python-list mailing list