New submission from Andrii V. Mishkovskyi <[EMAIL PROTECTED]>: locale.format() doesn't insert correct decimal separator to string representation when 'format' argument has '\r' or '\n' symbols in it. This bug has been reproduced on Python 2.5.2 and svn-trunk.
Python 2.4.5 (#2, Mar 12 2008, 14:42:24) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, "ru_RU.UTF-8") 'ru_RU.UTF-8' >>> a = 1.234 >>> print locale.format("%f", a) 1,234000 >>> print locale.format("%f\n", a) 1,234000 >>> print locale.format("%f\r", a) 1,234000 Python 2.6a1+ (trunk:62083, Mar 31 2008, 19:24:56) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu6)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, "ru_RU.UTF-8") 'ru_RU.UTF-8' >>> a = 1.234 >>> print locale.format("%f", a) 1,234000 >>> print locale.format("%f\n", a) 1.234000 >>> print locale.format("%f\r", a) 1.234000 Python 2.5.2 (r252:60911, Mar 12 2008, 13:36:25) [GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu4)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import locale >>> locale.setlocale(locale.LC_ALL, "ru_RU.UTF-8") 'ru_RU.UTF-8' >>> a = 1.234 >>> print locale.format("%f", a) 1,234000 >>> print locale.format("%f\n", a) 1.234000 >>> print locale.format("%f\r", a) 1.234000 ---------- messages: 64787 nosy: mishok13 severity: normal status: open title: locale.format() problems with decimal separator type: behavior versions: Python 2.5, Python 2.6 __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2522> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com