This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author serhiy.storchaka
Recipients mark.dickinson, python-dev, serhiy.storchaka
Date 2012-10-18.19:21:20
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <201210182220.51833.storchaka@gmail.com>
In-reply-to <1350586351.5.0.511768200474.issue16277@psf.upfronthosting.co.za>
Content
> So maybe the fix should be to special case zero in PyLong_AsVoidPtr, and
> turn 0L back into NULL there?

Yes, of course. If we have a special case in PyLong_FromVoidPtr(), it is wrong 
that we do not have the special case in PyLong_AsVoidPtr(). But this will 
change the current (potentially buggy) behaviour. ;-)

The patch long_fromvoidptr_2.patch contains such changes (as you want).

But this changes are buggy too, because now PyLong_FromVoidPtr() and 
PyLong_AsVoidPtr() are multivalued. PyLong_FromVoidPtr() maps to 0 NULL and 
may be yet another pointer, PyLong_AsVoidPtr() maps to NULL 0 and may be yet 
another integer.

The patch long_fromvoidptr_3.patch is more consistent in this sense. Now both 
functions are univalued, 

> I think it's just too risky to change the current behaviour in 3.2 and 3.3,
> given the number of places that PyLong_FromVoidPtr is used.  

Buggy behaviour changed if we fix the bug.

> Unlike you, I
> don't have confidence that there are no current or future platforms that
> don't map NULL to 0.

I just want to say that I'm not sure whether to fix this bug. But if we fix it 
for purity, it should be fixed right.
Files
File name Uploaded
long_fromvoidptr_2.patch serhiy.storchaka, 2012-10-18.19:21:20
long_fromvoidptr_3.patch serhiy.storchaka, 2012-10-18.19:21:20
History
Date User Action Args
2012-10-18 19:21:20serhiy.storchakasetrecipients: + serhiy.storchaka, mark.dickinson, python-dev
2012-10-18 19:21:20serhiy.storchakalinkissue16277 messages
2012-10-18 19:21:20serhiy.storchakacreate