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 ztane
Recipients ztane
Date 2016-05-02.13:07:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1462194444.45.0.679859267338.issue26906@psf.upfronthosting.co.za>
In-reply-to
Content
This is an annoying heisenbug; it seems that some objects cannot be formatted until you explicitly do obj.__format__. For example `object.__reduce__` behaves like this:

    Python 2.7.10 (default, Oct 14 2015, 16:09:02)
    [GCC 5.2.1 20151010] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> format(object.__reduce__)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: Type method_descriptor doesn't define __format__
    >>> format(object.__reduce__)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: Type method_descriptor doesn't define __format__
    >>> object.__reduce__.__format__
    <built-in method __format__ of method_descriptor object at 0x7f67563ed0e0>
    >>> format(object.__reduce__)
    "<method '__reduce__' of 'object' objects>"

I can replicate this in 2.7.9, .10 and .11 on Ubuntu and Debian, though it works on Windows Python, works in 2.6.6, and Pythons 3 wherever I've tried, but I've heard this also failing on Python 3.
History
Date User Action Args
2016-05-02 13:07:24ztanesetrecipients: + ztane
2016-05-02 13:07:24ztanesetmessageid: <1462194444.45.0.679859267338.issue26906@psf.upfronthosting.co.za>
2016-05-02 13:07:24ztanelinkissue26906 messages
2016-05-02 13:07:23ztanecreate