From 79357d7fddbde9384aadba9408d6ca1a4c81f948 Mon Sep 17 00:00:00 2001 From: thurask Date: Fri, 3 Nov 2017 01:32:19 -0400 Subject: [PATCH] work around encoding errors with chinese text in check response --- tcllib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tcllib.py b/tcllib.py index 82437a8..99375f4 100644 --- a/tcllib.py +++ b/tcllib.py @@ -145,7 +145,7 @@ class FotaCheck: except OSError as e: if e.errno != errno.EEXIST: raise - with open(outfile, "w") as f: + with open(outfile, "w", encoding="utf-8") as f: f.write(data) def do_check(self, https=True, timeout=10, max_tries=5):