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 ncoghlan
Recipients alex, gvanrossum, ncoghlan
Date 2017-11-08.02:55:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za>
In-reply-to
Content
As per the post at https://mail.python.org/pipermail/python-dev/2017-November/150366.html, this is an RFE to cover adding a new warning filter to the default set:

    once::DeprecationWarning:__main__

This means that all deprecation warnings triggered directly by code in __main__ will start being reported again, while deprecation warnings triggered by imported modules will continue to be ignored by default.

Thus the following will start emitting DeprecationWarning by default again (as they did in 2.6 and earlier):

- experiments at the REPL
- directly executed scripts
- modules executed with the -m switch
- pkg.__main__ submodules executed with the -m switch
- __main__.py files in executed directories and zip archives

However, any code *imported* from these will not trigger warnings.

This means that the following still won't trigger any warnings by default:

- modules imported & functions called from entry point wrapper scripts
- modules imported & functions called from pkg.__main__ submodules
- modules imported & functions called from __main__.py files

The intent behind the change is that it should be much harder for developers and educators to miss seeing a deprecation warning at least once for a deprecated API, while still silencing deprecation warnings by default for deployed Python applications.
History
Date User Action Args
2017-11-08 02:55:09ncoghlansetrecipients: + ncoghlan, gvanrossum, alex
2017-11-08 02:55:09ncoghlansetmessageid: <1510109709.08.0.213398074469.issue31975@psf.upfronthosting.co.za>
2017-11-08 02:55:08ncoghlanlinkissue31975 messages
2017-11-08 02:55:08ncoghlancreate