set encoding="utf8" so that can have special chars in files. ..otherwhise reads fail

This commit is contained in:
PySimpleGUI 2021-01-30 18:23:56 -05:00
parent f883506703
commit 2b6ce7590e
1 changed files with 1 additions and 1 deletions

View File

@ -72,7 +72,7 @@ def find_in_file(string):
for file in demo_files: for file in demo_files:
filename = os.path.join(demo_path, file) filename = os.path.join(demo_path, file)
try: try:
with open(filename, 'r') as f: with open(filename, 'r', encoding="utf8") as f:
for line in f.readlines(): for line in f.readlines():
if string in line.lower(): if string in line.lower():
file_list.append(file) file_list.append(file)