Diego Argueta <diego.argu...@gmail.com> added the comment: That's because the stream isn't transcoding, since UTF-8 is ASCII-compatible. Try using something not ASCII-compatible as the codec e.g. 'ibm500' and it'll give incorrect results.
``` b = io.BytesIO(u'a,b\r\n"asdf","jkl;"\r\n'.encode('ibm500')) s = codecs.EncodedFile(b, 'ibm500') ``` ``` Got header: '\x81k\x82\r%' Skipping the header. '\x7f\x81\xa2\x84\x86\x7fk\x7f\x91\x92\x93^\x7f\r%' Line 2: '\x81k\x82\r%' Line 3: '\x7f\x81\xa2\x84\x86\x7fk\x7f\x91\x92\x93^\x7f\r%' ``` ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue33361> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com