This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author flox
Recipients docs@python, flox
Date 2010-09-06.00:11:19
SpamBayes Score 4.7526566e-08
Marked as misclassified No
Message-id <1283731883.01.0.461973913755.issue9780@psf.upfronthosting.co.za>
In-reply-to
Content
According to the documentation:
"The fill character can be any character other than ‘}’ (which signifies the end of the field)."
http://docs.python.org/dev/library/string.html#format-specification-mini-language


However the format() builtin accepts both '{' and '}' characters:

>>> format(42, '}^6')
'}}42}}'

>>> format(42, '{^6')
'{{42{{'


And the string method rejects both characters.

>>> '{:}^6}'.format(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Single '}' encountered in format string

>>> '{:{^6}'.format(42)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: unmatched '{' in format
History
Date User Action Args
2010-09-06 00:11:23floxsetrecipients: + flox, docs@python
2010-09-06 00:11:23floxsetmessageid: <1283731883.01.0.461973913755.issue9780@psf.upfronthosting.co.za>
2010-09-06 00:11:20floxlinkissue9780 messages
2010-09-06 00:11:19floxcreate