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
Date 2009-05-09.19:50:14
SpamBayes Score 1.483258e-13
Marked as misclassified No
Message-id <1241898617.16.0.557804357136.issue5981@psf.upfronthosting.co.za>
In-reply-to
Content
Two problems with float.fromhex:

(1) it incorrectly rejects trailing whitespace on infs and nans:

>>> float.fromhex('a.0 ')
10.0
>>> float.fromhex('nan ')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid hexadecimal floating-point string

(2) The implementation uses PyOS_strnicmp for detecting nans and infs,
which is locale-aware.  A locale-unaware case-insensitive comparison 
should be used instead.  I don't know of any locale where this actually 
makes a difference, but I think it should be fixed anyway.
History
Date User Action Args
2009-05-09 19:50:17mark.dickinsonsetrecipients: + mark.dickinson
2009-05-09 19:50:17mark.dickinsonsetmessageid: <1241898617.16.0.557804357136.issue5981@psf.upfronthosting.co.za>
2009-05-09 19:50:15mark.dickinsonlinkissue5981 messages
2009-05-09 19:50:14mark.dickinsoncreate