[issue3140] str.format("{0:n}") poss. bug with setlocale()
Eric Smith
report at bugs.python.org
Tue Jun 24 13:21:38 CEST 2008
Eric Smith <eric at trueblade.com> added the comment:
Fixed in r64499 (trunk) and r64500 (py3k).
I now get:
>>> import locale
>>> locale.setlocale(locale.LC_ALL, "en_US.UTF-8")
'en_US.UTF-8'
>>> for x in
(123,1234,12345,123456,1234567,12345678,123456789,1234567890,12345678900):
... print("[{0:>20n}]".format(x))
...
[ 123]
[ 1,234]
[ 12,345]
[ 123,456]
[ 1,234,567]
[ 12,345,678]
[ 123,456,789]
[ 1,234,567,890]
[ 12,345,678,900]
and:
>>> for x in
(123,1234,12345,123456,1234567,12345678,123456789,1234567890,12345678900):
... print("[{0:>10n}]".format(x))
...
[ 123]
[ 1,234]
[ 12,345]
[ 123,456]
[ 1,234,567]
[12,345,678]
[123,456,789]
[1,234,567,890]
[12,345,678,900]
----------
resolution: -> fixed
status: open -> closed
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue3140>
_______________________________________
More information about the Python-bugs-list
mailing list