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 exarkun
Recipients exarkun
Date 2008-09-04.22:10:08
SpamBayes Score 0.00031168555
Marked as misclassified No
Message-id <1220566209.35.0.614126643007.issue3781@psf.upfronthosting.co.za>
In-reply-to
Content
This example shows the behavior:

    from warnings import catch_warnings

    def test():
        with catch_warnings(True) as w:
            assert str(w.message) == "foo", "%r != %r" % (w.message, "foo")

    test()

This fails with an IndexError from the `w.message`.  That's a bit
surprising, and since this is mostly an API useful for testing, it'd be
much better if it had a well-defined, documented (ie, stable and likely
to continue working in the next release of Python) error mode.
History
Date User Action Args
2008-09-04 22:10:09exarkunsetrecipients: + exarkun
2008-09-04 22:10:09exarkunsetmessageid: <1220566209.35.0.614126643007.issue3781@psf.upfronthosting.co.za>
2008-09-04 22:10:08exarkunlinkissue3781 messages
2008-09-04 22:10:08exarkuncreate