[python-win32] Win32: -2147418113, 'Catastrophic failure'
Mark Hammond
mhammond at skippinet.com.au
Tue May 23 11:39:11 EDT 2023
On 2023-05-22 11:05 a.m., Pranav S Pawar wrote:
> Hello Team,
>
> My code was working fine from one week in jupyter notebook.
> Today i just did a kernel restart in jupyter notebook and my code
> stopped working.
>
> Not sure what happened after restart. Tried all options but not able
> to resolve.
> So through to get help from here.
>
> Basically i am trying to get erwin api through =>
> win32com.client.Dispatch("erwin9.SCAPI")
Again, this sounds like an issue with erwin, not python/pywin32.
Cheers,
Mark
>
> but getting error.
>
> Giving Code as well as error below.
> Please advise what corrective action should be taken.
> I have tried to upgrade pywin32 module but still same error.
>
> *Code:*
> import win32com.client
> erwin = win32com.client.Dispatch("erwin9.SCAPI")
> print('Connected')
>
> *Error:*
>
> com_error Traceback (most recent call last)
> FileC:\Python310\lib\site-packages\win32com\client\dynamic.py:84, in_GetGoodDispatch(IDispatch, clsctx)
> 83 try:
> ---> 84 IDispatch= pythoncom.connect(IDispatch)
> 85 except pythoncom.ole_error:
>
> com_error: (-2147221021, 'Operation unavailable', None, None)
>
> During handling of the above exception, another exception occurred:
>
> com_error Traceback (most recent call last)
> InputIn [17], in<cell line: 3>()
> 1 import win32com.client
> ----> 3 erwin= win32com.client.Dispatch("erwin9.SCAPI")
> 5 print('Connected')
>
> FileC:\Python310\lib\site-packages\win32com\client\__init__.py:118, inDispatch(dispatch, userName, resultCLSID, typeinfo, UnicodeToString,
> clsctx)
> 116 """Creates a Dispatch based COM object."""
> 117 assert UnicodeToStringis None,"this is deprecated and will go away"
> --> 118 dispatch, userName= dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
> 119 return __WrapDispatch(dispatch, userName, resultCLSID, typeinfo, clsctx=clsctx)
>
> FileC:\Python310\lib\site-packages\win32com\client\dynamic.py:104, in_GetGoodDispatchAndUserName(IDispatch, userName, clsctx)
> 101 ## ??? else userName remains None ???
> 102 else:
> 103 userName= str(userName)
> --> 104 return (_GetGoodDispatch(IDispatch,clsctx), userName)
>
> FileC:\Python310\lib\site-packages\win32com\client\dynamic.py:86, in_GetGoodDispatch(IDispatch, clsctx)
> 84 IDispatch= pythoncom.connect(IDispatch)
> 85 except pythoncom.ole_error:
> ---> 86 IDispatch= pythoncom.CoCreateInstance(
> 87 IDispatch,None,clsctx,pythoncom.IID_IDispatch
> 88 )
> 89 else:
> 90 # may already be a wrapped class.
> 91 IDispatch= getattr(IDispatch,"_oleobj_", IDispatch)
>
> com_error: (-2147418113, 'Catastrophic failure', None, None)
>
> Thanks & Best Regards,
>
> Pranav
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/python-win32/attachments/20230523/063cd7aa/attachment-0001.html>
More information about the python-win32
mailing list