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.

Author vstinner
Recipients berker.peksag, rhettinger, serhiy.storchaka, vstinner, yselivanov
Date 2016-05-21.21:21:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463865677.61.0.478047631986.issue27077@psf.upfronthosting.co.za>
In-reply-to
Content
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)
        ...
History
Date User Action Args
2016-05-21 21:21:17vstinnersetrecipients: + vstinner, rhettinger, berker.peksag, serhiy.storchaka, yselivanov
2016-05-21 21:21:17vstinnersetmessageid: <1463865677.61.0.478047631986.issue27077@psf.upfronthosting.co.za>
2016-05-21 21:21:17vstinnerlinkissue27077 messages
2016-05-21 21:21:17vstinnercreate