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 berker.peksag, eric.smith, r.david.murray, serhiy.storchaka, socketpair
Date 2016-10-08.14:06:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475935612.73.0.76805261278.issue28385@psf.upfronthosting.co.za>
In-reply-to
Content
Sorry, but it looks to me that issue28385.diff solves wrong issue. The issue is not in bytes, but in default __format__. object.__format__ should raise an error message that contains the name of the actual type. There are other issues with object.__format__, following patch tries to solve them.

1. Error message now contains the name of the actual type.

2. Format spec is checked before converting the value to str. Converting bytes and bytearray to str can raise a BytesWarning, and it is better if the type of this error doesn't depend on the -b option.

3. Since format spec is always empty, avoid calling PyObject_Format(). In theory PyObject_Str() can raise a subclass of str with non-trivial __format__, but I think we can ignore this subtle behavior difference.
History
Date User Action Args
2016-10-08 14:06:52serhiy.storchakasetrecipients: + serhiy.storchaka, eric.smith, r.david.murray, socketpair, berker.peksag
2016-10-08 14:06:52serhiy.storchakasetmessageid: <1475935612.73.0.76805261278.issue28385@psf.upfronthosting.co.za>
2016-10-08 14:06:52serhiy.storchakalinkissue28385 messages
2016-10-08 14:06:52serhiy.storchakacreate