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 mark.dickinson
Recipients asvetlov, gregory.p.smith, jcea, loewis, mark.dickinson, meador.inge, serhiy.storchaka
Date 2012-07-25.08:11:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343203910.38.0.537487048787.issue15402@psf.upfronthosting.co.za>
In-reply-to
Content
[Martin]
> The patch that Meador committed is incorrect: METH_NOARGS functions
> still take a PyObject* args argument, which will be NULL.

Hmm.  I see this usage in a lot of places---e.g. see unicode_capitalize, unicode_casefold, unicode_title etc. in Objects/unicodeobject.c.  So it looks like we're relying on the (PyCFunction) cast to convert from a one-argument function pointer to a two-argument function pointer, which sounds a bit worrisome---I guess it just happens to work with common ABI calling conventions. I'm a bit surprised that we're not seeing compiler warnings about this sort of thing.

[Meador]
> I will happily fix it, but if it is wrong one place, then it is wrong
> everywhere.

It sounds like 'wrong everywhere' is accurate, unfortunately.
History
Date User Action Args
2012-07-25 08:11:50mark.dickinsonsetrecipients: + mark.dickinson, loewis, gregory.p.smith, jcea, asvetlov, meador.inge, serhiy.storchaka
2012-07-25 08:11:50mark.dickinsonsetmessageid: <1343203910.38.0.537487048787.issue15402@psf.upfronthosting.co.za>
2012-07-25 08:11:49mark.dickinsonlinkissue15402 messages
2012-07-25 08:11:49mark.dickinsoncreate