[python-win32] Python wmi problem

Tim Golden tim.golden at viacom-outdoor.co.uk
Fri Mar 11 09:48:11 CET 2005


[Paul Eden]
| I am interested in using the wmi wrapper module for the 
| windows wmi python classes/modules and am having trouble.
|
| Here is what happens.
|
| >>> import wmi
|
| [... snip full traceback ...]
|  File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line 554, in AddModuleToCache
|     dict = mod.CLSIDToClassMap
| AttributeError: 'module' object has no attribute 'CLSIDToClassMap'
|
| I am using python 2.4, windows XP, pywin32 extensions build 203.

I realise that this is no consolation whatsoever, but it
works fine for me (although I admit I do still develop
under Python 2.3 for various reasons so I can miss
compatibility issues with 2.4).

Hopefully someone else has some idea what's going on,
since the error is deep within the pywin32 COM stuff,
rather than with the WMI wrapper itself.

FWIW, you could try changing the win32com.client.gencache.EnsureDispatch 
lines in wmi.py to be simply win32com.client.Dispatch; you would probably
then have to determine the values of the constants which not now available:

wbemErrInvalidQuery = -2147217385
wbemErrTimedout     = -2147209215
wbemFlagReturnImmediately = 16
wbemFlagForwardOnly = 32

If you're not sure how to do that, let me know and I can send you
a patched copy.

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________


More information about the Python-win32 mailing list