[python-win32] Possible bug: what information to provide

Alex Jouravlev alexj at businessabstraction.com
Thu Oct 13 05:06:18 CEST 2005


Thanks, Mark,

> > One more strange thing:
> > MakePy recognised the object as "IRepository" rather then "Repository"
>
> I'm not sure what you mean here.  Please post a complete code sample,
> including all output that confuses you or you believe to be wrong.
>
Makepy.py output (fragment, for information about the Object)
-----------------------------------------------
class IRepository(DispatchBaseClass):
	CLSID = IID('{F2DC9B8B-3ACE-4AD1-A863-2321C60220AB}')
	coclass_clsid = None

...............

	def GetLastError(self):
		return self._ApplyTypes_(14, 1, (12, 0), (), 'GetLastError', None,)

.......................
	def OpenFile2(self, FileName=defaultNamedNotOptArg,
Username=defaultNamedNotOptArg, Password=defaultNamedNotOptArg):
		return self._oleobj_.InvokeTypes(18, LCID, 1, (11, 0), ((12, 0), (12, 0),
(12, 0)),FileName
			, Username, Password)

--------------------------------------------------------------------

PythonWin Dialogue
------------------------------
>>> import win32com
>>> rep = win32com.client.Dispatch('EA.Repository')
>>> rep.OpenFile2("C:\Test.eap","","")
True
>>> rep.GetLastError()
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
TypeError: 'unicode' object is not callable
>>>
-----------------------------------------------------


> The code above is not using makepy, even though it may have been run.  You
> could try creating the object using
> win32com.client.gencache.EnsureDispatch

I tried, here is the result:
-----------------------------------
>>> rep = win32com.client.gencache.EnsureDispatch('EA.Repository')
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
  File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line
543, in EnsureDispatch
    raise TypeError, "This COM object can not automate the makepy process -
please run makepy manually for this object"
TypeError: This COM object can not automate the makepy process - please run
makepy manually for this object
>>>
---------------------------------------

Thanks again,

Alex




More information about the Python-win32 mailing list