eryksun added the comment:

bytes.__str__ can already raise either a warning (-b) 

    >>> str('abcäöü'.encode('utf-8'))
    __main__:1: BytesWarning: str() on a bytes instance
    "b'abc\\xc3\\xa4\\xc3\\xb6\\xc3\\xbc'"

or error (-bb), which applies equally to implicit conversion by print():

    >>> print('abcäöü'.encode('utf-8'))
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    BytesWarning: str() on a bytes instance

----------
nosy: +eryksun

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

Reply via email to