1
0

use explicit utf-8 encoding when opening files in text mode

This commit is contained in:
SomberNight
2018-03-23 21:47:51 +01:00
parent 382f69edd9
commit 9b7536e75c
11 changed files with 25 additions and 25 deletions

View File

@@ -810,7 +810,7 @@ def versiontuple(v):
def import_meta(path, validater, load_meta):
try:
with open(path, 'r') as f:
with open(path, 'r', encoding='utf-8') as f:
d = validater(json.loads(f.read()))
load_meta(d)
#backwards compatibility for JSONDecodeError
@@ -824,7 +824,7 @@ def import_meta(path, validater, load_meta):
def export_meta(meta, fileName):
try:
with open(fileName, 'w+') as f:
with open(fileName, 'w+', encoding='utf-8') as f:
json.dump(meta, f, indent=4, sort_keys=True)
except (IOError, os.error) as e:
traceback.print_exc(file=sys.stderr)