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 vstinner
Recipients Arfrever, msmhrt, ned.deily, pitrou, python-dev, serhiy.storchaka, vstinner
Date 2016-03-24.23:15:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
It looks like logging a warning at Python exit always works on Python 2.7:
import _warnings

class Bla:
    def __del__(self, w=_warnings):
        w.warn_explicit('message', DeprecationWarning, '', 5)

bla = Bla()

It looks like it uses the Python implementation and linecache.getline() always works. Maybe the warning is emitted earlier that the Python 3 code emitting ResourceWarning. I see that of Python 2 imports linecache at top level, whereas the Python 3 code imports the module at the first use in showwarning(). I recall that imports at top level are avoided to get faster startup time.
Date User Action Args
2016-03-24 23:15:09vstinnersetrecipients: + vstinner, pitrou, ned.deily, Arfrever, python-dev, serhiy.storchaka, msmhrt
2016-03-24 23:15:09vstinnersetmessageid: <>
2016-03-24 23:15:09vstinnerlinkissue21925 messages
2016-03-24 23:15:09vstinnercreate