SystemError: NULL result without error in call_object

Gaetan Corneau corg at copernic.com
Thu May 11 10:12:18 EDT 2000


Mark,

> > returned integers, but in Python, I still got single element tuples
> > containing my values.
> 
> This is working as expected.  If you look closer at Next(), you will
> notice it takes a param for how many elements to fetch - the 
> default is 1.

I know, I had to imp^lement this interface :)

> You _always_ get a tuple of that size, even when you request only 1.

I don't understand. Look at the following:

>>> from win32com.client.dynamic import Dispatch
>>> ie = Dispatch("internetexplorer.application")
>>> ie.Navigate("www.copernic.com")
>>> doc = ie.Document
>>> for link in doc.Links:
...     print link
...
http://www.copernic.com/
http://www.copernic.com/index.html
http://www.copernic.com/products/free/
http://www.copernic.com/products/plus/
http://www.copernic.com/products/pro/
http://www.copernic.com/products/mac/
http://www.copernic.com/addons/
http://www.copernic.com/awards/
http://www.copernic.com/support/
http://www.copernic.com/company/
[... some links deleted ...]

>>> link
<COMObject <unknown>>
>>>

This uses IEnumVariant, and links are IDispatch, not tuples. I don have to
write:
print link[0]

What I get with my enumerator is
(<COMObject <unknown>>,)


> So what happened to the bug? 

If I return variants, I don't get it anymore.

> Have you determined exactly 
> what causes the "null result without error" message?  One
> guess is that you setup the
> variant as VT_DISPATCH, but leave a NULL pointer in the 
> variant.

That's what I thought, but it is not the case. I really return the correct
number of objects.
If I find more about my bug, I'll let you know.
______________________________________________________
   Gaetan Corneau
   Software Developer 
   Copernic.com 
   http://www.copernic.com
   E-mail: corg at copernic.com                         
______________________________________________________
"Les Télétubbies, c'est de la musique d'ascenseur pour les yeux"








More information about the Python-list mailing list