Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment:

The problem here is not the bytes object: it is correctly coerced to a
string. 

The problem is the binary stream, which cannot accept strings.
We could maybe detect common errors and add a check at the beginning of
the print() function? something like
    if isinstance(file, (BufferedWriter, RawIOBase)):
        raise ValueError("file should be a text stream")

----------
nosy: +amaury.forgeotdarc

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

Reply via email to