From 4e5941cdf485232eb171ca72141b01ad8d5ec709 Mon Sep 17 00:00:00 2001 From: Manuel Cortez Date: Wed, 12 Jun 2019 22:43:57 -0500 Subject: [PATCH] Fixed issue with logging unicode characters in some cp1252 systems --- src/main.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main.py b/src/main.py index 04b77f3..bd25171 100644 --- a/src/main.py +++ b/src/main.py @@ -12,7 +12,7 @@ import sys storage.setup() # Let's import config module here as it is dependent on storage being setup. import config -logging.basicConfig(filename=os.path.join(storage.data_directory, "info.log"), level=logging.DEBUG, filemode="w") +logging.basicConfig(handlers=[logging.FileHandler(os.path.join(storage.data_directory, "info.log"), "w", "utf-8")], level=logging.DEBUG) # Let's mute the google discovery_cache logger as we won't use it and we'll avoid some tracebacks. glog = logging.getLogger("googleapiclient.discovery_cache") glog.setLevel(logging.CRITICAL)