Message 151728 - Python tracker (original) (raw)

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 "", line 1, in 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".