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:54:27
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1637024067.36.0.989642400667.issue43526@roundup.psfhosted.org>
In-reply-to
Content
While you should not do that at home ;-), it's now *technically* possible to change the BytesWarning flag at runtime using a a *private* *internal* API:

$ ./python
Python 3.11.0a2+ (heads/remove_asyncore:010015d2eb, Nov 11 2021,

>>> "unicode" == b"bytes"
False

# Change the internal BytesWarning flag
>>> import _testinternalcapi
>>> config=_testinternalcapi.get_config()
>>> config['bytes_warning']=1
>>> _testinternalcapi.set_config(config)

>>> "unicode" == b"bytes"
<stdin>:1: BytesWarning: Comparison between bytes and string
False
History
Date User Action Args
2021-11-16 00:54:27vstinnersetrecipients: + vstinner, gregory.p.smith, methane, xmorel, serhiy.storchaka
2021-11-16 00:54:27vstinnersetmessageid: <1637024067.36.0.989642400667.issue43526@roundup.psfhosted.org>
2021-11-16 00:54:27vstinnerlinkissue43526 messages
2021-11-16 00:54:27vstinnercreate