On Windows 10 the logging module send this error (using scrapy)
# --- Logging error ---
...
# UnicodeEncodeError: 'charmap' codec can't encode characters in position 175-176: character maps to <undefined>
I have read that I should add EDIT: According to the tuto it isnt needed. encoding='utf-8'
but I did not find how I could add it in the code below.
configure_logging(install_root_handler=False) #override default log settings
logging.basicConfig(
filename='logfile.log',
format='%(levelname)s: %(message)s',
datefmt='%m-%d %H:%M',
level=logging.INFO #CRITICAL ERROR WARNING INFO DEBUG NOTSET
)
I found many questions on the topics, but mostly on python 2 (or not related to the logging module). And the logging tutorial don't even talk about utf-8. (Notice that I can print UTF8 characters without any problem. The problem only occur with the logging module)