Undocumented Python 2.6 change: Py_None vs NULL when C implementation raises exception

"Martin v. Löwis" martin at v.loewis.de
Thu Jul 24 22:21:49 CEST 2008

> I have no plans to track down the exact change in Python code that
> caused this. There does not seem to be much point, since according to
> Fredrik this seems to be an area that is practically undefined and the
> M2Crypto code was clearly buggy.

I see, and I agree with Fredrik's analysis. It might actually be that
there was *no* change in 2.6 causing this change in behavior, but just
a difference in data returned in the actual application. E.g. if a
PyInt_FromLong returns -1, the caller also needs to check for
PyErr_Occurred, which would then detect an earlier exception. So it
might be that if you have -1 in your data, you see the exception, but
if you have -2 instead, you won't see it.


More information about the Python-list mailing list