Bugs item #2843647, was opened at 2009-08-25 02:06
Message generated for change (Settings changed) made by mhammond
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2843647&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: pythonwin
Group: None
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: docduke (docduke)
Assigned to: Nobody/Anonymous (nobody)
Summary: SimpleCOMServer from PPW32 p. 68 dies in PyWin 2.5, 2.6, 3.1
Initial Comment:
My objective is a server-side COM to call from VB 6.0 SP6, to do mathematics better.
* The server demo in the book dies the same way no matter how I try it. Both from Word VBA and from VB6 SP6, the error is:
Microsoft Visual Basic
Run-time error '-214746259 (80004005)':
Unexpected Python Error: Traceback (most recent call last):
File "C:\c\Python3\lib\site-packages\win32com\server\policy.py", line 278, in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\c\Python3\lib\site-packages\win32com\server\policy.py", line 283, in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
The traceback beyond here (and the underscores) are cut off by VB. I got the full last line from the source. I haven't figured out how to get the full traceback from PyWin.
* This is similar to 2391931, for which M. Hammond wrote: "You need to install a global copy of the MSVC2008 assemblies from Microsoft for this to work."
* Based on a Google search, I interpreted that to mean: "Microsoft Visual C++ 2008 SP1 Redistributable Package (x86)" which I installed. The error message is unchanged. I have also seen remarks about "COM updates," but that is not specific enough for me to have any idea what to look for.
Please help!
----------------------------------------------------------------------
>Comment By: Mark Hammond (mhammond)
Date: 2009-08-25 13:49
Message:
Thanks for the followup!
----------------------------------------------------------------------
Comment By: docduke (docduke)
Date: 2009-08-25 12:19
Message:
First, thank you very much for your prompt response!
Now that PyWin knows the master is watching ...
I have run this code at least a dozan times, and it has failed every time!
So with your comments, I went back, and it ran! However, I rebooted the
computer to confirm that it was not a fluke, and it failed again. The
explanation is embarassing ... I will give the complete traceback in a
moment, but for other readers, the solution is more important.
The first successful run must have been in PyWin 25 or 26 (I don't
remember that I switched). The failure was in PyWin 31. The reason (see
the traceback!) is that I needed to change: "return string.split(str(val),
item)" to "return str(val).split(item)" for 3.1. The thing I didn't
realize is that the compiler didn't catch the method error until the VB
call executed it, so the "return code 0" didn't mean the code was
functional.
Here is the full trace collection (Thanks for explaining how to get it in
Chapter 7!):
# This window will display output from any programs that import
win32traceutil
# win32com servers registered with '--debug' are in this category.
Object with win32trace dispatcher created (object=None)
in <SimpleCOMServer.PythonUtilities object at 0x03A9CA10>._QueryInterface_
with unsupported IID b'IPersistStreamInit'
({7FD52380-4E07-101B-AE2D-08002B2EC713})
in <SimpleCOMServer.PythonUtilities object at 0x03A9CA10>._QueryInterface_
with unsupported IID b'IPersistPropertyBag'
({37D84F60-42CB-11CE-8135-00AA004BB851})
in _GetIDsOfNames_ with '('SplitString',)' and '1033'
in _Invoke_ with 1000 1033 3 ('Hello to FSC',)
Traceback (most recent call last):
File "C:\c\Python31\lib\site-packages\win32com\server\dispatcher.py",
line 47, in _Invoke_
return self.policy._Invoke_(dispid, lcid, wFlags, args)
File "C:\c\Python31\lib\site-packages\win32com\server\policy.py", line
278, in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\c\Python31\lib\site-packages\win32com\server\policy.py", line
283, in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None,
None)
File "C:\c\Python31\lib\site-packages\win32com\server\policy.py", line
586, in _invokeex_
return func(*args)
File "C:\a\pywin\SimpleCOMServer.py", line 14, in SplitString
return string.split(str(val), item)
AttributeError: 'module' object has no attribute 'split'
Thanks again!
----------------------------------------------------------------------
Comment By: Mark Hammond (mhammond)
Date: 2009-08-25 08:05
Message:
Without the full traceback it is hard to be sure, but assuming the solution
is appropriate, you are *not* lookig for the "SP1" version of those libs -
just the 'plain' pre-SP1 ones.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=551954&aid=2843647&group_id=78018
|