Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:

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.

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue43526>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to