➜

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.

作者 Arfrever
收信人 Arfrever, barry, brian.curtin, eric.araujo, pitrou, pjenvey, skrah
日期 2014-01-22.21:41:46
SpamBayes Score -1.0
Marked as misclassified 是
Message-id <1390426906.93.0.692922610327.issue20355@psf.upfronthosting.co.za>
In-reply-to
内容
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.)
历史
日期 用户 动作 参数
2014-01-22 21:41:47Arfrever修改recipients: + Arfrever, barry, pitrou, pjenvey, eric.araujo, brian.curtin, skrah
2014-01-22 21:41:46Arfrever修改messageid: <1390426906.93.0.692922610327.issue20355@psf.upfronthosting.co.za>
2014-01-22 21:41:46Arfrever链接issue20355 messages
2014-01-22 21:41:46Arfrever创建