[issue12014] str.format parses replacement field incorrectly

Eric V. Smith report at bugs.python.org
Fri May 6 10:47:19 CEST 2011


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

I haven't had time to completely review this, I will do so later today.

But let me just say that the string is first parsed for replacement strings inside curly braces. There's no issue with that, here.

Next, the string is parsed for conversion and format_spec, looking for "!" and ":" respectively. In your first example that gives:

field_name: '0['
conversion : ']'

It then tries to parse the field_name and gives you the first error.

----------

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


More information about the Python-bugs-list mailing list