[New-bugs-announce] [issue6656] locale.format_string fails on escaped percentage

Christoph Burgmer report at bugs.python.org
Thu Aug 6 13:09:38 CEST 2009


New submission from Christoph Burgmer <cburgmer at ira.uka.de>:

locale.format_string doesn't return same result as a normal
"string" % format
directive, but raises a TypeError. See attached test case for Python
2.6.

>>> locale.format_string('%f%%', 1.0)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.5/locale.py", line 195, in format_string
    return new_f % val
TypeError: not enough arguments for format string
>>> '%f%%' % 1.0
'1.000000%'

----------
components: Library (Lib)
files: locale_percents_test.diff
keywords: patch
messages: 91352
nosy: christoph
severity: normal
status: open
title: locale.format_string fails on escaped percentage
versions: Python 2.5, Python 2.6
Added file: http://bugs.python.org/file14665/locale_percents_test.diff

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6656>
_______________________________________


More information about the New-bugs-announce mailing list