[python-win32] suggested change to pywintypes.py for non-admininstall

Mark Hammond mhammond at skippinet.com.au
Fri Mar 9 04:53:47 CET 2007


> Mark and others,
>
> For a non-admin install pywintypesXY.dll and pythoncomXY.dll
> cannot be put in
> the system directory. The typical alternative is to put them
> in the install
> dir, next to python.exe. "pywintypes.py" is setup to know how
> to find it when
> doing either of:
>
>      import pywintypes
>      import pythoncom
>
> However, doing any of (and similar):
>
>      import win32api
>      from win32com.shell import shell
>
> fails. You have to do one of the former first.

Yeah - that sucks.  I actually wasn't aware it did it for a normal Python
non-admin install (although if I thought more about when I had seen it, I
should have worked it out!)

> If however we put the system DLLs next to win32api.pyd et al
> (and update
> pywintypes.py to look there) then those imports work. The
> win32comext imports
> seems to work too because "win32api" will have been imported by then.

That sounds OK I guess - not actually *good*, but sounds like it will be an
improvement (and I can't see the "good" answer).  It will not help someone
who does 'import customwin32' (ie, their own module linked against
pywintypes), but OTOH, the change would not make it *more* broken for them
than it already is.

We'd need a change to win32_postinstall.py to remove an existing copy from
the old location too I guess, just to be safe.  Now might not be a bad time
either - build 210 has proven to be stable and a large number of changes
have been checked into CVS since then (notably Roger's 64bit work).  This
means I'll probably declare build 211 as 'beta quality' and recommend people
do not update critical systems, so a change like this could also bake there
to see if it has legs.

I welcome all other comments though.

Cheers,

Mark



More information about the Python-win32 mailing list