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 lkcl, mark.dickinson, pitrou
Date 2009-01-20.12:18:04
SpamBayes Score 2.705114e-12
Marked as misclassified No
Message-id <1232453886.73.0.00894439472818.issue4977@psf.upfronthosting.co.za>
In-reply-to
Content
Antoine, I leave it to you to decide what to do with this.

As far as I can see, the only action that one might want to take
as a result of this issue is to replace strtol with PyOS_strol
in the codebase (in the struct module, and there's also an
occurrence in Objects/floatobject.c in the fromhex method).

I recommend against this though, for a few reasons:

1. PyOS_strtol is likely slower than strtol.

2. PyOS_strtol is itself buggy:  for example, it incorrectly
accepts strings like "- 3", with whitespace between the sign
and the unsigned part.  This is the reason that Python accepts
'- 3' as an input to int;  this is a Python bug that can't be
changed in 2.x for compatibility reasons.  It's fixed in 3.x.

3. There's nothing wrong with the existing code, and changing
it risks introducing new bugs.  It's the platform that's buggy here: 
its strtol method doesn't comply with the C89 standard (or the C99
standard, for that matter).

It's true that Python has code to work around problems with standards
compliance on some platforms, and if this were a supported platform
then I'd be okay with making the change.  As it is, though, I think this
should be reclosed (as invalid, or won't fix if that makes people feel
happier).

BTW, Luke, note that you can still add comments to an issue even after
the issue has been closed:  people subscribed to that issue (via nosy)
will still see the messages.
History
Date User Action Args
2009-01-20 12:18:06mark.dickinsonsetrecipients: + mark.dickinson, lkcl, pitrou
2009-01-20 12:18:06mark.dickinsonsetmessageid: <1232453886.73.0.00894439472818.issue4977@psf.upfronthosting.co.za>
2009-01-20 12:18:05mark.dickinsonlinkissue4977 messages
2009-01-20 12:18:04mark.dickinsoncreate