In the program below, a UnicodeEncodeError is fired on my computer running Windows 10 (running Python 3.5.2), but there is no error on my Linux machine (running Python 3.3.2).
import logging
str ="Antonín Dvořák"
logging.basicConfig(filename='log.txt', level=logging.INFO)
logging.info(str)
On Linux, the log file correctly contains:
INFO:root:Antonín Dvořák
On Windows, I get the following error:

Any ideas on what could be causing this mismatch?
source
share