The -b flag, which turns on checks which emit BytesWarnings on
operations mixing bytes and str objects, is very useful.
However, the only way to set this flag is via the Python invocation.
This limits its usability in contexts where the user's control of the
Python invocation is limited, e.g when using Python embedded in another
executable (such as uwsgi). There appears to be no function which can
set the flag, and no environment variable which controls it.
Up to Python 3.7, the extension module provided by the bytes-warning
package works around this (it exposes a function which allows
setting the flag from within Python). But with 3.8 (and I suspect,
because of PEP-587 related changes), this fails silently and the sys
flag bytes_warning remains unaffected.
Can we have a non-invocation way to control this flag?
Python-ideas mailing list -- firstname.lastname@example.org
To unsubscribe send an email to email@example.com
Message archived at https://firstname.lastname@example.org/message/FV37A5SIQGY4VJ6ESUNAMVXHUXUHUVGO/
Code of Conduct: http://python.org/psf/codeofconduct/