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 serhiy.storchaka
Recipients ezio.melotti, serhiy.storchaka, vstinner
Date 2016-09-14.11:12:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za>
In-reply-to
Content
For example:

>>> '{:04}'.format('abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: '=' alignment not allowed in string format specifier

There is no any '=' in the format string.

>>> '{: }'.format('abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Sign not allowed in string format specifier

There is no any sign ('+' or '-') in the format string.

There also an inconsistency between the wording of "something not allowed in string format specifier" and:

>>> '{:x}'.format('abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'x' for object of type 'str'
>>> '{:xx}'.format('abc')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Invalid format specifier
History
Date User Action Args
2016-09-14 11:12:35serhiy.storchakasetrecipients: + serhiy.storchaka, vstinner, ezio.melotti
2016-09-14 11:12:35serhiy.storchakasetmessageid: <1473851555.69.0.998405869153.issue28146@psf.upfronthosting.co.za>
2016-09-14 11:12:35serhiy.storchakalinkissue28146 messages
2016-09-14 11:12:35serhiy.storchakacreate