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 mark.dickinson, vstinner
Date 2010-06-08.21:42:45
SpamBayes Score 0.00079481135
Marked as misclassified No
Message-id <1276033368.49.0.876712618605.issue8950@psf.upfronthosting.co.za>
In-reply-to
Content
Currently all but one of the integer format codes for getargs.c raise TypeError when passed a float.  The 'L' code produces a warning rather than raising an error.

This was deliberate at the time, because all except the 'L' code already raised a DeprecationWarning in Python 3.1, and were converted to raise TypeError for 3.2.  Since the 'L' code didn't raise a warning for float inputs in 3.1, directly raising a TypeError in 3.2 seemed a bit abrupt.

However, I'd like to revisit this decision, and make the 'L' code raise a TypeError in 3.2.  Note that

(1) The 'L' code represents the Py_LONG_LONG type, and isn't used very much;  I think the risk of unexpected breakage from this change is fairly small.

(2) One of the places that the 'L' code *is* used is when parsing strange C types (like off_t) that are matched with either size_t, long or long long at configure + build time.  So one platform might end up parsing off_t types with the 'n' code, while another parses them with the 'L' code.  It would be desirable for both platforms to have the same behaviour when passed a float.

Any objections to making this change?

See also issue 5080.
History
Date User Action Args
2010-06-08 21:42:48mark.dickinsonsetrecipients: + mark.dickinson, vstinner
2010-06-08 21:42:48mark.dickinsonsetmessageid: <1276033368.49.0.876712618605.issue8950@psf.upfronthosting.co.za>
2010-06-08 21:42:46mark.dickinsonlinkissue8950 messages
2010-06-08 21:42:45mark.dickinsoncreate