Author Arfrever
Recipients Arfrever, barry, brett.cannon, brian.curtin, eric.araujo, larry, pitrou, pjenvey, skrah
Date 2014-01-23.09:19:48
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1390468789.64.0.236388970509.issue20361@psf.upfronthosting.co.za>
In-reply-to
Content
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.)
History
Date User Action Args
2014-01-23 09:19:49Arfreversetrecipients: + Arfrever, barry, brett.cannon, pitrou, larry, pjenvey, eric.araujo, brian.curtin, skrah
2014-01-23 09:19:49Arfreversetmessageid: <1390468789.64.0.236388970509.issue20361@psf.upfronthosting.co.za>
2014-01-23 09:19:49Arfreverlinkissue20361 messages
2014-01-23 09:19:49Arfrevercreate