Message208894
Currently -W command line options and PYTHONWARNINGS environmental variable non-intuitively override settings specified by -b / -bb command line options.
$ python3.4 -c 'print("" == b"")'
False
$ python3.4 -b -c 'print("" == b"")'
-c:1: BytesWarning: Comparison between bytes and string
False
$ python3.4 -bb -c 'print("" == b"")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
BytesWarning: Comparison between bytes and string
$ python3.4 -We -b -c 'print("" == b"")'
Traceback (most recent call last):
File "<string>", line 1, in <module>
BytesWarning: Comparison between bytes and string
$ python3.4 -Wd -bb -c 'print("" == b"")'
-c:1: BytesWarning: Comparison between bytes and string
False
$ python3.4 -Wi -b -c 'print("" == b"")'
False
$ python3.4 -Wi -bb -c 'print("" == b"")'
False
$
I suggest to increase priority of -b / -bb command line options.
The attached patch should be applied after patch from issue #20355.
(Test suite of Python triggers some BytesWarnings, so firstly they will have to be fixed.) |
|
Date |
User |
Action |
Args |
2014-01-23 09:19:49 | Arfrever | set | recipients:
+ Arfrever, barry, brett.cannon, pitrou, larry, pjenvey, eric.araujo, brian.curtin, skrah |
2014-01-23 09:19:49 | Arfrever | set | messageid: <1390468789.64.0.236388970509.issue20361@psf.upfronthosting.co.za> |
2014-01-23 09:19:49 | Arfrever | link | issue20361 messages |
2014-01-23 09:19:49 | Arfrever | create | |
|