[python-win32] EnsureModule raises AssertionError if typelib is updated

Koen Van Herck koen_van_herck at yahoo.com
Fri Mar 5 05:03:35 EST 2004


I use win32com.client.EnsureModule() to import my typelib. If the typelib
itself (the DLL) is updated (e.g. using "touch"), EnsureModule will cause
the following error:

File "C:\Python23\lib\site-packages\win32com\client\gencache.py", line 507,
in EnsureModule
module = MakeModuleForTypelib(typelibCLSID, lcid, major, minor,
progressInstance, bForDemand = bForDemand, bBuildHidden = bBuildHidden)
File "C:\Python23\lib\site-packages\win32com\client\gencache.py", line 279,
in MakeModuleForTypelib
makepy.GenerateFromTypeLibSpec( (typelibCLSID, lcid, major, minor),
progressInstance=progressInstance, bForDemand = bForDemand, bBuildHidden =
bBuildHidden)
File "C:\Python23\lib\site-packages\win32com\client\makepy.py", line 273, in
GenerateFromTypeLibSpec
gencache.AddModuleToCache(info.clsid, info.lcid, info.major, info.minor)
File "C:\Python23\lib\site-packages\win32com\client\gencache.py", line 542,
in AddModuleToCache
assert not mod.__dict__.has_key("_in_gencache_"), \
AssertionError: This module has already been processed by this process

The files in gen_py are updated correctly, and if I run the same script
again, EnsureModule works fine (until I update the DLL again).

Any help?

Thanks,
Koen Van Herck.




More information about the Python-win32 mailing list