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 <1458861309.87.0.922704195885.issue21925@psf.upfronthosting.co.za>
In-reply-to
Content
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, 'x.py', 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 warnings.py 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.
History
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: <1458861309.87.0.922704195885.issue21925@psf.upfronthosting.co.za>
2016-03-24 23:15:09vstinnerlinkissue21925 messages
2016-03-24 23:15:09vstinnercreate