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 eric.smith
Recipients docs@python, eric.smith, py.user, r.david.murray, terry.reedy
Date 2012-01-21.09:47:17
SpamBayes Score 5.55112e-17
Marked as misclassified No
Message-id <>
While looking at object.__format__, I recall that we've already addressed this, sort of. For a different reason, this is already deprecated in 3.3 and will become an error in 3.4. See issues 9856 and 7994.

$ ./python -Wd
Python 3.3.0a0 (default:40e1be1e0707, Jan 15 2012, 00:58:51) 
[GCC 4.6.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> format([], 'd')
__main__:1: DeprecationWarning: object.__format__ with a non-empty format string is deprecated
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: Unknown format code 'd' for object of type 'str'
[67288 refs]

We could still have object.__format__ catch and re-throw the ValueError with a better message. I'd have to think it through if we could catch all ValueErrors, or if it's possible for another ValueError to be thrown and we'd only catch and rethrow this specific ValueError.

But since this is deprecated, I'm not sure it's worth the hassle. I'd advocate closing this issue as "won't fix".
Date User Action Args
2012-01-21 09:47:19eric.smithsetrecipients: + eric.smith, terry.reedy, r.david.murray, docs@python, py.user
2012-01-21 09:47:19eric.smithsetmessageid: <>
2012-01-21 09:47:18eric.smithlinkissue13790 messages
2012-01-21 09:47:18eric.smithcreate