Message266030
On Python 3, comparison between str and bytes raises a BytesWarning exception if python3 is started with -bb. But sometimes, you really want to compare str with bytes. For example, os.get_exec_path() changes temporarely the BytesWarning warning for that!
# {b'PATH': ...}.get('PATH') and {'PATH': ...}.get(b'PATH') emit a
# BytesWarning when using python -b or python -bb: ignore the warning
with warnings.catch_warnings():
warnings.simplefilter("ignore", BytesWarning)
... |
|
Date |
User |
Action |
Args |
2016-05-21 21:21:17 | vstinner | set | recipients:
+ vstinner, rhettinger, berker.peksag, serhiy.storchaka, yselivanov |
2016-05-21 21:21:17 | vstinner | set | messageid: <1463865677.61.0.478047631986.issue27077@psf.upfronthosting.co.za> |
2016-05-21 21:21:17 | vstinner | link | issue27077 messages |
2016-05-21 21:21:17 | vstinner | create | |
|