[python-win32] python com error - 'module' object has no attribute 'CLSIDToClassMap' strangeness

Richard Bell rbell01824 at earthlink.net
Wed Aug 1 15:39:25 CEST 2007


I've a COM application that automated IE that I've been working on for some
months.  This mourning I get the following error message when I run a test
that ran successfully last night:

=== H2 tag in IFRAME but is NOT visible when the frame is visible, need to
scroll
-- flashTag H2
-- tagScreenCord H2
Traceback (most recent call last):
  File "C:\rbell\Bell Curve Group\IE Testing\t070731a.py", line 382, in
<module>
    flashTag(tag)
  File "C:\rbell\Bell Curve Group\IE Testing\t070731a.py", line 299, in
flashTag
    tagL, tagT, tagW, tagH = _tagScreenCord(tag)
  File "C:\rbell\Bell Curve Group\IE Testing\t070731a.py", line 192, in
_tagScreenCord
    winL, winT, winW, winH, winscrollL, winscrollT =
_winLTWHSLT(_iewin(tag))
  File "C:\rbell\Bell Curve Group\IE Testing\t070731a.py", line 263, in
_winLTWHSLT
    win3 = win32com.client.CastTo(win, 'IHTMLWindow3')      # cast to get
screen...
  File "C:\Python25\Lib\site-packages\win32com\client\__init__.py", line
132, in CastTo
    ob = gencache.EnsureDispatch(ob)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
536, in EnsureDispatch
    mod = EnsureModule(tla[0], tla[1], tla[3], tla[4],
bForDemand=bForDemand)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
393, in EnsureModule
    module = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
262, in GetModuleForTypelib
    AddModuleToCache(typelibCLSID, lcid, major, minor)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
554, in AddModuleToCache
    dict = mod.CLSIDToClassMap
AttributeError: 'module' object has no attribute 'CLSIDToClassMap'

An attempt to run makePY on the 'HTML Object Library' yielded the following
error:

Generating to
C:\DOCUME~1\rbell\LOCALS~1\Temp\gen_py\2.5\3050F1C5-98B5-11CF-BB82-00AA00BDC
E0Bx0x4x0.py
Building definitions from type library...
Generating...
Importing module
Failed to execute command:
from win32com.client import makepy;makepy.main()
Traceback (most recent call last):
  File
"C:\Python25\Lib\site-packages\pythonwin\pywin\framework\toolmenu.py", line
103, in HandleToolCommand
    exec "%s\n" % pyCmd
  File "<string>", line 1, in <module>
  File "C:\Python25\lib\site-packages\win32com\client\makepy.py", line 363,
in main
    GenerateFromTypeLibSpec(arg, f, verboseLevel = verboseLevel, bForDemand
= bForDemand, bBuildHidden = hiddenSpec)
  File "C:\Python25\lib\site-packages\win32com\client\makepy.py", line 271,
in GenerateFromTypeLibSpec
    gencache.AddModuleToCache(info.clsid, info.lcid, info.major, info.minor)
  File "C:\Python25\Lib\site-packages\win32com\client\gencache.py", line
554, in AddModuleToCache
    dict = mod.CLSIDToClassMap
AttributeError: 'module' object has no attribute 'CLSIDToClassMap'

Deleting the gen_py output directory and re-running makepy SUCCEEDS and
subsequently the test application runs OK again.

So the symptom is resolved, but any clues as to how this could have
happened.  This is a VERY long running application (think 24x7 for years)
and I'm concerned that whatever caused this might occur again.

Thanks for any clues.

Regards,
Richard




More information about the python-win32 mailing list