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 serhiy.storchaka
Recipients serhiy.storchaka, xmorel
Date 2021-03-17.09:45:28
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1615974328.38.0.814388667866.issue43526@roundup.psfhosted.org>
In-reply-to
Content
Yes, it is intended behaviour. BytesWarning is only emitted when you set a special internal flag (by the -b option). Warning filters control what happen with that warning later: be it ignored, printed, or converted to exception.

In normal circumstances you should never deal with BytesWarning. The -b option is only used for testing your program for some possible bugs caused by migration from Python 2. If your program always worked only with Python 3, the -b option has no use for you.

It may be more complicated if you write a library which support bytes and strings. Since you do not know in what program it will be used, it may be nice to to test it with mixed bytes and str data and ensure that it works with bytes warnings enabled.
History
Date User Action Args
2021-03-17 09:45:28serhiy.storchakasetrecipients: + serhiy.storchaka, xmorel
2021-03-17 09:45:28serhiy.storchakasetmessageid: <1615974328.38.0.814388667866.issue43526@roundup.psfhosted.org>
2021-03-17 09:45:28serhiy.storchakalinkissue43526 messages
2021-03-17 09:45:28serhiy.storchakacreate