Bugs item #1548903, was opened at 2006-08-29 14:49
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1548903&group_id=78018
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: com
Group: v1.0 (example)
Status: Open
Resolution: None
Priority: 5
Submitted By: Dudley McFadden (dudmc3)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incomplete gen_py cache file results from missing typelib
Initial Comment:
Under certain circumstances, gencache raises an
unhandled exception, resulting in a cache file (in the
gen_py directory) that is incomplete.
The first time that makepy or gencache.EnsureModule is
invoked, the cache file is created. However, it
contains only the 26-line or so header. The next time
gencache is invoked, it sees the cache file, presumes
it is complete, then exits normally. User code
subsequently fails. Since there is an (apparently)
valid file is available in gen_py for the server and
the user has correctly registered the COM server, it
is perplexing why the user's code doesn't work.
In my example, the inital exception is raised by
build.py in _ResolveType, at line 452:
resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr)
The exception is raised when there is an unregistered
CLSID being referenced by the type library under
inspection. In my example, I have a method that needs
a reference to a certain interface as an argument.
That interface is to a COM server that is not
registered.
I developed a workaround by modifying the code around
the line noted above to read as:
try:
resultTypeInfo = itypeinfo.GetRefTypeInfo(subrepr)
except pythoncom.com_error:
return pythoncom.VT_EMPTY, None, None
but this is clearly a "punt." The GetRefTypeInfo
raises an exception because the CLSID described in its
argument is not registered.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1548903&group_id=78018
|