set encoding="utf8" so that can have special chars in files. ..otherwhise reads fail
This commit is contained in:
parent
f883506703
commit
2b6ce7590e
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue