[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.

Eric V. Smith report at bugs.python.org
Thu Jan 19 01:54:45 CET 2012


Eric V. Smith <eric at trueblade.com> added the comment:

The existing exceptions use the text "format code" for what the documentation calls "type":

>>> format(9, "h")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'h' for object of type 'int'

So to be consistent, it should say:

>>> format(9, "xx10f")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format code

----------

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


More information about the Python-bugs-list mailing list