[issue13706] non-ascii fill characters no longer work in formatting

Stefan Krah report at bugs.python.org
Wed Jan 4 00:44:16 CET 2012


Stefan Krah <stefan-usenet at bytereef.org> added the comment:

Actually the issue is not restricted to numeric formatting. It's not
possible to pad a Unicode string with a non-ascii whitespace:

>>> format("abcd", "\u2007<7")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: fill character too large



I'd be more than happy to restrict all numerical I/O operations to
ASCII. This includes input strings for int(), float(), Decimal().


It does break backwards compatibility though and the situation
for string formatting above seems odd to me. It is worse when
the rejected fill character is already present in the string:


>>> format("\u2007abcd", "\u2007<7")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: fill character too large

----------
title: non-ascii fill characters no longer work in numeric formatting -> non-ascii fill characters no longer work in formatting

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


More information about the Python-bugs-list mailing list