Bugs item #1548903, was opened at 2006-08-30 07:49
Message generated for change (Comment added) made by mhammond
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: Closed
>Resolution: Fixed
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.
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2006-09-23 00:19
Message:
Logged In: YES
user_id=14198
Thanks!
Checking in build.py;
new revision: 1.30; previous revision: 1.29
----------------------------------------------------------------------
Comment By: Dudley McFadden (dudmc3)
Date: 2006-09-06 02:37
Message:
Logged In: YES
user_id=817716
Attached is a cleaner fix to this issue. It requires
importing winerror. Not sure if this is the optimal
solution but it would appear to be a passable one.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=1548903&group_id=78018
|