[New-bugs-announce] [issue5247] Unhelpful error message with str.format()

Antoine Pitrou report at bugs.python.org
Fri Feb 13 15:12:55 CET 2009


New submission from Antoine Pitrou <pitrou at free.fr>:

>>> "{0:f}".format(2.5)
'2.500000'
>>> "{0:f}".format("spam")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown conversion type f

The error message should mention the type of the argument that doesn't
support the given conversion type (e.g. "Unknown conversion type f for
object of type 'float'"). Otherwise it can be very confusing.

----------
components: Interpreter Core
messages: 81931
nosy: pitrou
priority: normal
severity: normal
status: open
title: Unhelpful error message with str.format()
type: behavior
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1

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


More information about the New-bugs-announce mailing list