Issue1512745

classification
Title: large precision string format fix
Type: Severity: normal
Components: None Versions:
Milestone:
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: cgroves
Priority: normal Keywords: patch

Created on 2006-06-26.14:09:25 by cgroves, last changed 2006-07-19.02:42:22 by cgroves.

Files
File name Uploaded Description Edit Remove
longStringFormatPrecision.patch cgroves, 2006-07-04.01:45:41 doesn't check precision on strings
Messages
msg2512 (view) Author: Charlie Groves (cgroves) Date: 2006-06-26.14:09:25
Currently Jython only allows format strings to have a
maximum precision of 250 for all formatting types but
python only restricts the precision on floats.   ie

milo:~ groves$ jytip 
Jython 2.2a1 on java1.5.0_06 (JIT: null)
Type "copyright", "credits" or "license" for more
information.
>>> '%.250s' % 'hello'
'hello'
>>> '%.400s' % 'hello'
Traceback (innermost last):
  File "<console>", line 1, in ?
OverflowError: formatted float is too long (precision
too long?)
>>> ^D
milo:~ groves$ python
Python 2.4.3 (#1, Apr  7 2006, 10:54:33) 
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for
more information.
>>> '%.250s' % 'hello'
'hello'
>>> '%.400s' % 'hello'
'hello'

The attached patch moves the precision check to the
float only formatting section.
msg2513 (view) Author: Charlie Groves (cgroves) Date: 2006-07-19.02:42:22
Logged In: YES 
user_id=1174327

This was applied to the 2.3 branch as part of
http://fisheye3.cenqua.com/changelog/jython/?cs=2842

It should still probably be applied to the trunk.
History
Date User Action Args
2006-06-26 14:09:25cgrovescreate