From d5e227c2a6c9170e0dee3e34b4a495dbc6d513be Mon Sep 17 00:00:00 2001 From: ThaaoBlues <40574784+ThaaoBlues@users.noreply.github.com> Date: Fri, 18 Jun 2021 23:33:58 +0200 Subject: [PATCH 1/2] Fixed 'charmap' codec can't decode byte 0x8f Fixed an error in load_file() function that occured while reading some character. Simply precised an encoding (UTF-8) as optionnal argument of open() function. --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index f2b4651..1aee756 100755 --- a/app.py +++ b/app.py @@ -646,9 +646,10 @@ class SocialAnalyzer(): f.write(file.content) if path.exists(path_to_check) == True: self.print_wrapper("[init] {} looks good!".format(name)) - with open(path_to_check) as f: + with open(path_to_check,encoding="utf-8") as f: ret = load(f) except Exception as e: + print(e) self.print_wrapper("[!] {} Does not exist! cannot be downloaded...".format(name)) return ret From c5828509e709030b923d4fda65009347669e89c7 Mon Sep 17 00:00:00 2001 From: ThaaoBlues <40574784+ThaaoBlues@users.noreply.github.com> Date: Fri, 18 Jun 2021 23:55:27 +0200 Subject: [PATCH 2/2] forgot to delete the print(e) --- app.py | 1 - 1 file changed, 1 deletion(-) diff --git a/app.py b/app.py index 1aee756..920fceb 100755 --- a/app.py +++ b/app.py @@ -649,7 +649,6 @@ class SocialAnalyzer(): with open(path_to_check,encoding="utf-8") as f: ret = load(f) except Exception as e: - print(e) self.print_wrapper("[!] {} Does not exist! cannot be downloaded...".format(name)) return ret