Re: [python-win32] Win32: -2147418113, 'Catastrophic failure'

2023-05-23 Thread Steven Manross
And just to reiterate what Mark said, but also validate that this is the case 
from code:

You should be able to run this without issue… (and validate pywin32 works fine)

mydict = win32com.client.Dispatch("Scripting.Dictionary")

… since the “Scripting.Dictionary” COM class lives on every windows 
installation since Windows 2000 (or earlier).

Steven
From: python-win32  On 
Behalf Of Pranav S Pawar
Sent: Monday, May 22, 2023 8:05 AM
To: Mark Hammond ; python-win32@python.org
Subject: [python-win32] Win32: -2147418113, 'Catastrophic failure'

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")

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)

File C:\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)

Input In [17], in ()

  1 import win32com.client

> 3 erwin = win32com.client.Dispatch("erwin9.SCAPI")

  5 print('Connected')



File C:\Python310\lib\site-packages\win32com\client\__init__.py:118, in 
Dispatch(dispatch, userName, resultCLSID, typeinfo, UnicodeToString, clsctx)

116 """Creates a Dispatch based COM object."""

117 assert UnicodeToString is 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)



File C:\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)



File C:\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
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


Re: [python-win32] Win32: -2147418113, 'Catastrophic failure'

2023-05-23 Thread Mark Hammond

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()
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___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32


[python-win32] Win32: -2147418113, 'Catastrophic failure'

2023-05-23 Thread Pranav S Pawar
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")

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)
File C:\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)
Input In [17], in ()  1 import win32com.client>
3 erwin = win32com.client.Dispatch("erwin9.SCAPI")  5
print('Connected')

File C:\Python310\lib\site-packages\win32com\client\__init__.py:118,
in Dispatch(dispatch, userName, resultCLSID, typeinfo,
UnicodeToString, clsctx)116 """Creates a Dispatch based COM
object."""117 assert UnicodeToString is 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)

File C:\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)

File C:\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
___
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32