[issue18373] implement sys.get/setbyteswarningflag()

Daniel Holth report at bugs.python.org
Thu Jul 18 23:57:41 CEST 2013


Daniel Holth added the comment:

Python 3 is supposed to make it easier to do Unicode correctly. str(bytes) does not. I felt strongly enough about that to write this patch.

With this feature my library can have control in a way that is much more practical than ensuring a particular flag has been passed to the interpreter.

It might make sense to modify the patch so str(bytes) can throw a regular exception instead of a warning while under the influence of the new flag. The reason being that the warning will be suppressed the second time around but for this use case you wouldn't want that.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue18373>
_______________________________________


More information about the Python-bugs-list mailing list