R. David Murray added the comment: Python doesn't store the encoding information anywhere. The coding cookie is used to correctly convert the bytes in the file into unicode...otherwise they are just treated as bytes.
For the stdin case, the encoding is associated with the input stream, and again you either get unicode or bytes, there is no encoding information that is carried along with the data. So, when the conversion is attempted, there is no encoding information available to add to the error message. ---------- nosy: +r.david.murray resolution: -> invalid stage: -> committed/rejected status: open -> closed type: -> behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue17439> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com