From 2b6ce7590ebe0b13d86a4fb6e27759cb05ad2144 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 30 Jan 2021 18:23:56 -0500 Subject: [PATCH] set encoding="utf8" so that can have special chars in files. ..otherwhise reads fail --- DemoPrograms/Demo_GitHub_File_Copier.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DemoPrograms/Demo_GitHub_File_Copier.py b/DemoPrograms/Demo_GitHub_File_Copier.py index 80550c38..dc09f4ec 100644 --- a/DemoPrograms/Demo_GitHub_File_Copier.py +++ b/DemoPrograms/Demo_GitHub_File_Copier.py @@ -72,7 +72,7 @@ def find_in_file(string): for file in demo_files: filename = os.path.join(demo_path, file) try: - with open(filename, 'r') as f: + with open(filename, 'r', encoding="utf8") as f: for line in f.readlines(): if string in line.lower(): file_list.append(file)