SystemError: NULL result without error in call_object

Mark Hammond mhammond at skippinet.com.au
Wed May 10 19:51:04 EDT 2000


"Gaetan Corneau" <corg at copernic.com> wrote in message
news:C5A7720BDEB7D3118A5200E018C200A037F5E1 at EXCHANGE...
Mark,

> > If the object is attempting to return an array of COM objects (ie,
> > IDispatch or IUnknown pointers), then this is a bug in the
> > COM extensions recently fixed (I think I posted exactly when only a
> > couple of days ago...)

> I'm using 1.5.2 and win32all-129 with the latest patch. Is that supposed
to
> be OK, or should I look for a specific file?

129 has that fix, so it would appear to be something different.

> Yesterday night, I have been able to narrow down the problem to two
lines of
> code in my implementation of the "Next" function in my enumerator. If I
set
> the variant type to "variant", and put my IDispatch interfaces in, it
> *almost* work: instead of receiving an IDispatch in each iteration of my
> "for" loop, I get a single element tuple containing the IDispatch:
> (<COMObject <unknown>>,). I tried setting the variant type to "integer"
and
> 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.
You _always_ get a tuple of that size, even when you request only 1.

So what happened to the bug?  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.  If that
is true, Python should be more graceful...

Mark.






More information about the Python-list mailing list