Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment: > In 2.7, PyUnicode_Splitlines() first does: > string = PyUnicode_FromObject(string);
And it raises an exception if the string contains non-ASCII characters. It is better to avoid str<->unicode convertion as long as possible. And when do it for the output a warning, use "replace" or "backslashreplace" error handlers or "latin1" decoder to avoid a failure. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31285> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com