New submission from Arfrever Frehtes Taifersar Arahesis:
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.)
----------
components: Interpreter Core
messages: 208854
nosy: Arfrever, barry, brian.curtin, eric.araujo, pitrou, pjenvey, skrah
priority: normal
severity: normal
status: open
title: -W command line options should have higher priority than PYTHONWARNINGS
environmental variable
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue20355>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com