Andrew McNabb <amcn...@mcnabbs.org> added the comment:

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.

----------
nosy: +amcnabb
type: behavior -> crash

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue4606>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to