mirror of
https://github.com/stashapp/CommunityScripts.git
synced 2026-04-28 17:47:44 -05:00
[renamer] Enforce utf-8 encoding when opening FILE_DRYRUN_RESULT (#43)
This commit is contained in:
@@ -602,7 +602,7 @@ if PLUGIN_ARGS in ["DRYRUN_full","Process_full"]:
|
||||
if PLUGIN_ARGS == "Process_dry":
|
||||
if os.path.exists(FILE_DRYRUN_RESULT):
|
||||
scenes = {"scenes":[]}
|
||||
with open(FILE_DRYRUN_RESULT, 'r') as f:
|
||||
with open(FILE_DRYRUN_RESULT, 'r', encoding='utf-8') as f:
|
||||
for line in f:
|
||||
scene_id_file = line.split("|")[0]
|
||||
scenes["scenes"].append({"id": scene_id_file})
|
||||
@@ -628,7 +628,7 @@ if PLUGIN_ARGS == "Process_dry":
|
||||
if DRY_RUN:
|
||||
num_lines = 0
|
||||
if os.path.exists(FILE_DRYRUN_RESULT):
|
||||
num_lines = sum(1 for _ in open(FILE_DRYRUN_RESULT))
|
||||
num_lines = sum(1 for _ in open(FILE_DRYRUN_RESULT, encoding='utf-8'))
|
||||
if num_lines > 0:
|
||||
log.LogInfo("[DRY-RUN] There wil be {} file(s) changed. Check {} for more details".format(num_lines, FILE_DRYRUN_RESULT))
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user