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 gregory.p.smith, methane, serhiy.storchaka, vstinner, xmorel
Date 2021-11-16.00:57:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637024278.8.0.201369188979.issue43526@roundup.psfhosted.org>
In-reply-to
Content
> If this is intended behaviour, which seems to be the case according to ncoghlan's comment https://bugs.python.org/issue32230#msg307721, it should be clearly documented, as it's rather frustrating.

The -b command line documentation is not explicitly enough?

"Issue a warning when comparing bytes or bytearray with str or bytes with int. Issue an error when the option is given twice (-bb)."

https://docs.python.org/dev/using/cmdline.html#cmdoption-b

Modifying warning filters don't change how Python emits or not warnings. It only changes how emitted warnings are handlded: ignored, displayed, treated as errors.

The relationship between -b and BytesWarning is different than other warnings.

Should we add a note near the BytesWarning documentation?
https://docs.python.org/dev/library/exceptions.html#BytesWarning
History
Date User Action Args
2021-11-16 00:57:58vstinnersetrecipients: + vstinner, gregory.p.smith, methane, xmorel, serhiy.storchaka
2021-11-16 00:57:58vstinnersetmessageid: <1637024278.8.0.201369188979.issue43526@roundup.psfhosted.org>
2021-11-16 00:57:58vstinnerlinkissue43526 messages
2021-11-16 00:57:58vstinnercreate