Author amcnabb
Recipients LambertDW, amcnabb, robertluce, theller
Date 2009-07-30.03:59:45
SpamBayes Score 1.53092e-11
Marked as misclassified No
Message-id <1248926387.37.0.275185643216.issue4606@psf.upfronthosting.co.za>
In-reply-to
Content
I ran into this problem, too.  It took me a long time to track down the
segfaults.  It's really bad to pass in None and have the system pick
some random address instead of 0.

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. 
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.

This patch is a one-line fix (plus tests and documentation), and it
fixes a bug which crashes the interpreter.  The patch seems very
straightforward, and there is no way that code could depend on the
current behavior.  I'm not sure if my patch review counts for much, but
there you have it. :)

It would be great if this patch could be applied quickly and added to
the maintenance branch for 2.6.  Thanks.
History
Date User Action Args
2009-07-30 03:59:47amcnabbsetrecipients: + amcnabb, theller, LambertDW, robertluce
2009-07-30 03:59:47amcnabbsetmessageid: <1248926387.37.0.275185643216.issue4606@psf.upfronthosting.co.za>
2009-07-30 03:59:45amcnabblinkissue4606 messages
2009-07-30 03:59:45amcnabbcreate