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 <>
As per the post at, this is an RFE to cover adding a new warning filter to the default set:


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
- 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 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.
Date User Action Args
2017-11-08 02:55:09ncoghlansetrecipients: + ncoghlan, gvanrossum, alex
2017-11-08 02:55:09ncoghlansetmessageid: <>
2017-11-08 02:55:08ncoghlanlinkissue31975 messages
2017-11-08 02:55:08ncoghlancreate