[python-win32] wmi.py + pythonservice.exe

Mark Hammond mhammond at skippinet.com.au
Fri May 7 21:45:22 EDT 2004


> >In the mean time, I found an interesting work around.  If I
> >rename wmi.py
> >to anything else and then reference it accordingly, the problem
> >dissapears.  (ex. pywmi.py, import pywmi)  Due to deadlines,
> >I'll probably
> >have to come back and learn why this is the case later, but
> >I'm sure it
> >will provide some good insight and a learning experience
> >regarding python
> >internal workings.

It is possible that a "wmi.dll" is being found first on sys.path, and is
what is getting loaded.  It may also be that the sys.path{} was setup this
way only when running under the service context (eg, due to the user, etc)

I'm still love to know how it caused a silent fatal error - unless the
"wmi.dll/.pyd" found was indeed an old Python extension module built for a
different Python version.  (If it was just a "regular" windows DLL, it
should cause an ImportError, which should not be silent.)

Mark.




More information about the Python-win32 mailing list