RAH <rene.heym...@gmail.com> writes: > I experienced an incomprehensible behavior (I've spent already many hours on > this subject): the `file.write('string')` provides an error in run mode and > not when interpreted at the console.
Maybe, I can explain the behavior: the interactive interpreter uses magic to determine the console's encoding and automatically uses this for console output. No such magic in non-interactive interpreter use. Therefore, you can get "UnicodeEncoding" problems in non-interactive use which you do not see in interactive use. -- https://mail.python.org/mailman/listinfo/python-list