Author serhiy.storchaka
Recipients serhiy.storchaka
Date 2012-04-30.16:55:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1335804926.58.0.135059540144.issue14700@psf.upfronthosting.co.za>
In-reply-to
Content
Check for integer overflow for width and precision is buggy.

Just a few examples (on platform with 32-bit int):

>>> '%.21d' % 123
'000000000000000000123'
>>> '%.2147483648d' % 123
'123'
>>> '%.2147483650d' % 123
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: prec too big

>>> '%.21f' % (1./7)
'0.142857142857142849213'
>>> '%.2147483648f' % (1./7)
'0.142857'
>>> '%.2147483650f' % (1./7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: prec too big
History
Date User Action Args
2012-04-30 16:55:26serhiy.storchakasetrecipients: + serhiy.storchaka
2012-04-30 16:55:26serhiy.storchakasetmessageid: <1335804926.58.0.135059540144.issue14700@psf.upfronthosting.co.za>
2012-04-30 16:55:26serhiy.storchakalinkissue14700 messages
2012-04-30 16:55:25serhiy.storchakacreate