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 meador.inge
Recipients amaury.forgeotdarc, belopolsky, brian.curtin, ezio.melotti, kumma, mark.dickinson, meador.inge, vinay.sajip
Date 2012-02-14.05:44:50
SpamBayes Score 8.59989e-08
Marked as misclassified No
Message-id <1329198292.17.0.730141258843.issue9041@psf.upfronthosting.co.za>
In-reply-to
Content
After thinking about it a bit more I am OK with Vinay's proposal.  Attached is an updated patch.

Also, I also noticed that the 'struct' module has the same problem:

>>> big_int = int(sys.float_info.max) * 2
>>> struct.pack('d', big_int)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: required argument is not a float

but the 'array' module does the right thing:

>>> big_int = int(sys.float_info.max) * 2
[68068 refs]
>>> array.array('d', [big_int])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
OverflowError: long int too large to convert to float
[68068 refs]
>>> array.array('d', [""])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: a float is required

Mark, do you have any opinions on the error handling here and in the struct module?
History
Date User Action Args
2012-02-14 05:44:52meador.ingesetrecipients: + meador.inge, vinay.sajip, amaury.forgeotdarc, mark.dickinson, belopolsky, ezio.melotti, brian.curtin, kumma
2012-02-14 05:44:52meador.ingesetmessageid: <1329198292.17.0.730141258843.issue9041@psf.upfronthosting.co.za>
2012-02-14 05:44:51meador.ingelinkissue9041 messages
2012-02-14 05:44:51meador.ingecreate