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 Arfrever
Recipients Arfrever, barry, brian.curtin, eric.araujo, pitrou, pjenvey, skrah
Date 2014-01-22.21:41:46
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390426906.93.0.692922610327.issue20355@psf.upfronthosting.co.za>
In-reply-to
Content
Currently Python has non-intuitive behavior such that PYTHONWARNINGS environmental variable has higher priority than -W command line options.

$ python3.4 -c '__import__("warnings").warn("xxx", DeprecationWarning)'
$ python3.4 -Wd -c '__import__("warnings").warn("xxx", DeprecationWarning)'
-c:1: DeprecationWarning: xxx
$ python3.4 -We -c '__import__("warnings").warn("xxx", DeprecationWarning)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
DeprecationWarning: xxx
$ PYTHONWARNINGS="e" python3.4 -Wd -c '__import__("warnings").warn("xxx", DeprecationWarning)'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
DeprecationWarning: xxx
$ PYTHONWARNINGS="d" python3.4 -We -c '__import__("warnings").warn("xxx", DeprecationWarning)'
-c:1: DeprecationWarning: xxx
$


I think that settings from -W command line options should have higher priority than PYTHONWARNINGS environmental variable.

(Adding people from issue #7301 to nosy list.)
History
Date User Action Args
2014-01-22 21:41:47Arfreversetrecipients: + Arfrever, barry, pitrou, pjenvey, eric.araujo, brian.curtin, skrah
2014-01-22 21:41:46Arfreversetmessageid: <1390426906.93.0.692922610327.issue20355@psf.upfronthosting.co.za>
2014-01-22 21:41:46Arfreverlinkissue20355 messages
2014-01-22 21:41:46Arfrevercreate