Message 91103 - Python tracker (original) (raw)

Thanks for bringing my attention to this problem again, and for the review.

Andrew McNabb schrieb:

I looked at the attached patch, and it seems to me the only alternative approach would be to use PyLong_FromLong instead of PyInt_FromLong.

Using PyLong_FromLong doesn't make a difference at all, if you look into the ConvParam code.

However, since ConvParam already handles None appropriately, I think the fix in patch_ctypes_none_arg.diff really is the best way to do it.

The problem is that the patch changes the behaviour of the 'POINTER(...).from_param' methods, so I'm unsure if it can be applied to 2.6 (or even 2.5). Opinions?

This patch is a one-line fix (plus tests and documentation), and it fixes a bug which crashes the interpreter. The patch seems very

The patch is missing a 'Py_INCREF(value)' before the 'return value;', but this is a minor point.

straightforward, and there is no way that code could depend on the current behavior.

It could (on 32-bit systems), although I'm not sure if there is code that does.

I'm not sure if my patch review counts for much, but there you have it. :)