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 ezio.melotti
Recipients ezio.melotti, mnewman
Date 2010-02-15.09:42:20
SpamBayes Score 8.78127e-07
Marked as misclassified No
Message-id <1266227002.52.0.897226273765.issue7930@psf.upfronthosting.co.za>
In-reply-to
Content
This is the stripid implementation:

_re_stripid = re.compile(r' at 0x[0-9a-f]{6,16}(>+)$', re.IGNORECASE)
def stripid(text):
    """Remove the hexadecimal id from a Python object representation."""
    # The behaviour of %p is implementation-dependent in terms of case.
    if _re_stripid.search(repr(Exception)):
        return _re_stripid.sub(r'\1', text)
    return text

The problem is that repr(Exception) used to return <class exceptions.Exception at 0x00A64510> on Py<=2.4 but now returns <type 'exceptions.Exception'>, so the code inside the if is never executed (this is what happens where there are no unittests).
That 'if' has been introduced in r19750 and I think that the reason is to check if the id in 'text' is really an id and hence has the same format of the ids of other objects. I don't think this is really necessary though.
History
Date User Action Args
2010-02-15 09:43:22ezio.melottisetrecipients: + ezio.melotti, mnewman
2010-02-15 09:43:22ezio.melottisetmessageid: <1266227002.52.0.897226273765.issue7930@psf.upfronthosting.co.za>
2010-02-15 09:42:21ezio.melottilinkissue7930 messages
2010-02-15 09:42:20ezio.melotticreate