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 vajrasky
Recipients mark.dickinson, python-dev, vajrasky
Date 2013-08-05.10:35:00
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1375698901.01.0.0631110144547.issue18659@psf.upfronthosting.co.za>
In-reply-to
Content
Let me help you to debug this issue.

ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/a.py
import sys

INT_MAX = sys.maxsize
f = 1.2
format(f, ".%sf" % (INT_MAX + 1))
ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/a.py
Traceback (most recent call last):
  File "/tmp/a.py", line 5, in <module>
    format(f, ".%sf" % (INT_MAX + 1))
ValueError: Too many decimal digits in format string
ethan@amiau:~/Documents/code/python/cpython$ cat /tmp/b.py
import sys

INT_MAX = 2147483647
f = 1.2
format(f, ".%sf" % (INT_MAX + 1))
ethan@amiau:~/Documents/code/python/cpython$ ./python /tmp/b.py
Traceback (most recent call last):
  File "/tmp/b.py", line 5, in <module>
    format(f, ".%sf" % (INT_MAX + 1))
ValueError: precision too big

My question is whether we should have different exception message for these two cases?
History
Date User Action Args
2013-08-05 10:35:01vajraskysetrecipients: + vajrasky, mark.dickinson, python-dev
2013-08-05 10:35:01vajraskysetmessageid: <1375698901.01.0.0631110144547.issue18659@psf.upfronthosting.co.za>
2013-08-05 10:35:00vajraskylinkissue18659 messages
2013-08-05 10:35:00vajraskycreate