[Python-checkins] r71804 - in python/branches/py3k: Lib/test/test_types.py Objects/stringlib/formatter.h

eric.smith python-checkins at python.org
Wed Apr 22 19:04:28 CEST 2009


Author: eric.smith
Date: Wed Apr 22 19:04:27 2009
New Revision: 71804

Log:
Merged revisions 71802 via svnmerge from 
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r71802 | eric.smith | 2009-04-22 12:20:47 -0400 (Wed, 22 Apr 2009) | 1 line
  
  Fixed issue 5782: formatting with commas didn't work if no specifier type code was given.
........


Modified:
   python/branches/py3k/   (props changed)
   python/branches/py3k/Lib/test/test_types.py
   python/branches/py3k/Objects/stringlib/formatter.h

Modified: python/branches/py3k/Lib/test/test_types.py
==============================================================================
--- python/branches/py3k/Lib/test/test_types.py	(original)
+++ python/branches/py3k/Lib/test/test_types.py	Wed Apr 22 19:04:27 2009
@@ -350,6 +350,9 @@
         test(1234567, ',', '1,234,567')
         test(-1234567, ',', '-1,234,567')
 
+        # issue 5782, commas with no specifier type
+        test(1234, '010,', '00,001,234')
+
         # make sure these are errors
 
         # precision disallowed
@@ -567,6 +570,9 @@
         test(-1234.12341234, '013f', '-01234.123412')
         test(-123456.12341234, '011.2f', '-0123456.12')
 
+        # issue 5782, commas with no specifier type
+        test(1.2, '010,.2', '0,000,001.2')
+
         # 0 padding with commas
         test(1234., '011,f', '1,234.000000')
         test(1234., '012,f', '1,234.000000')

Modified: python/branches/py3k/Objects/stringlib/formatter.h
==============================================================================
--- python/branches/py3k/Objects/stringlib/formatter.h	(original)
+++ python/branches/py3k/Objects/stringlib/formatter.h	Wed Apr 22 19:04:27 2009
@@ -248,6 +248,7 @@
         case 'G':
         case '%':
         case 'F':
+        case '\0':
             /* These are allowed. See PEP 378.*/
             break;
         default:


More information about the Python-checkins mailing list