New submission from Antoine Pitrou <pit...@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 <rep...@bugs.python.org> <http://bugs.python.org/issue5247> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com