Message194470
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? |
|
Date |
User |
Action |
Args |
2013-08-05 10:35:01 | vajrasky | set | recipients:
+ vajrasky, mark.dickinson, python-dev |
2013-08-05 10:35:01 | vajrasky | set | messageid: <1375698901.01.0.0631110144547.issue18659@psf.upfronthosting.co.za> |
2013-08-05 10:35:00 | vajrasky | link | issue18659 messages |
2013-08-05 10:35:00 | vajrasky | create | |
|