COM problem .py versus .exe

Greg Miller greg_miller at nexpress.com
Mon Jun 27 08:08:12 EDT 2005


I have a .DLL that I am extracting the file version from using wmi.py.
The specific code is:

c = wmi.WMI()
        for f in
c.CIM_DataFile(Name="c:\\glossersdmsservices\\bin\\glosscmanager.dll"):
            sdmsver = f.Version

this works fine when running the application as a python file, when I
build the application into an executable, using py2exe, I get the
following error:

Traceback (most recent call last):
  File "autoStart.pyc", line 241, in test
  File "wmi.pyc", line 138, in ?
  File "win32com\client\gencache.pyc", line 540, in EnsureDispatch
  File "win32com\client\CLSIDToClass.pyc", line 50, in GetClass
KeyError: '{D2F68443-85DC-427E-91D8-366554CC754C}'

the .dll resides outside the directory of the executable.  The one
thing I notice is that the KeyError value is a different id than the
COM object I am accessing.  I'm not sure where the value in the
KeyError listed is coming from.  Do I have to do some preprocessing in
the build script?  I am at a bit of a loss here, so any input would be
appreciated.  Thanks in advance.




More information about the Python-list mailing list