[python-win32] Exception setting a string using COM

shurik aleksandrv at berkeley.edu
Mon Jun 2 20:19:28 CEST 2008


I was able to resolve this. The file application was interacting with resided
on a network share. Once I copied it to a local volume I was able to
manipulate the string without a problem.

Thanks,

Aleksandr


Tim Roberts wrote:
> 
> Aleksandr VLADIMIRSKIY wrote:
>> I'm attempting to set a string value using a COM interface to an
>> application. I get the following traceback. Could anyone help me
>> understand the nature of the error or how I might begin to discover it?
>> ...
>>
>> In [11]: item.Path = ""
>> ---------------------------------------------------------------------------
>> pywintypes.com_error                                 Traceback (most
>> recent call last)
>>
>> C:\<ipython console>
>>
>> c:\python24\lib\site-packages\win32com\client\__init__.py in
>> __setattr__(self, attr, value)
>>     461                 except KeyError:
>>     462                         raise AttributeError, "'%s' object has no
>> attribute '%s'" % (repr(self), attr)
>> --> 463                 self._oleobj_.Invoke(*(args + (value,) +
>> defArgs))
>>     464         def _get_good_single_object_(self, obj, obUserName=None,
>> resultCLSID=None):
>>     465                 return _get_good_single_object_(obj, obUserName,
>> resultCLSID)
>>
>> com_error: (-2147352567, 'Exception occurred.', (0, None, None, None, 0,
>> -2147467259), None)
>>   
> 
> -2147467259 is 80004005, which is the rather unhelpful E_FAIL.
> 
> Sometimes, when it is mapping a settable/gettable property, the Python 
> COM mapper creates a separate method for setting.  You might try:
>     item.setPath( "" )
> 
> -- 
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
> 
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32
> 
> 

-- 
View this message in context: http://www.nabble.com/Exception-setting-a-string-using-COM-tp17570153p17606929.html
Sent from the Python - python-win32 mailing list archive at Nabble.com.



More information about the python-win32 mailing list