mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-09-01 23:25:15 +00:00
Always use UTF-8 to open files in list_sources.py.
This avoids problems with some locale settings. Signed-off-by: Eduardo Sánchez Muñoz <eduardosanchezmunoz@gmail.com> (github: eduardosm)
This commit is contained in:
committed by
John Preston
parent
8b54910538
commit
2eff766e88
@@ -23,6 +23,7 @@ import sys
|
|||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
|
import codecs
|
||||||
|
|
||||||
def eprint(*args, **kwargs):
|
def eprint(*args, **kwargs):
|
||||||
print(*args, file=sys.stderr, **kwargs)
|
print(*args, file=sys.stderr, **kwargs)
|
||||||
@@ -32,7 +33,7 @@ def check_non_empty_moc(file_path):
|
|||||||
if not os.path.isfile(file_path):
|
if not os.path.isfile(file_path):
|
||||||
return False
|
return False
|
||||||
if re.search(r'\.h$', file_path):
|
if re.search(r'\.h$', file_path):
|
||||||
with open(file_path, "r") as f:
|
with codecs.open(file_path, mode="r", encoding="utf-8") as f:
|
||||||
for line in f:
|
for line in f:
|
||||||
if re.search(r'(^|\s)Q_OBJECT(\s|$)', line):
|
if re.search(r'(^|\s)Q_OBJECT(\s|$)', line):
|
||||||
return True
|
return True
|
||||||
|
Reference in New Issue
Block a user