From 15459627cc80eaefcb78d581e99b391b5cd71cb1 Mon Sep 17 00:00:00 2001 From: Guy Elsmore-Paddock Date: Sat, 20 Mar 2021 15:59:44 -0400 Subject: [PATCH] Fix `UnicodeEncodeError` on Windows Platforms Prevents the following error from appearing when running training on Windows platforms: ``` UnicodeEncodeError: 'charmap' codec can't encode characters in position: character maps to ``` --- TTS/utils/io.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TTS/utils/io.py b/TTS/utils/io.py index 03fd810b..1703de6f 100644 --- a/TTS/utils/io.py +++ b/TTS/utils/io.py @@ -69,7 +69,7 @@ def copy_model_files(c, config_file, out_path, new_fields): else: new_line = '"{}":{},\n'.format(key, json.dumps(value, ensure_ascii=False)) config_lines.insert(1, new_line) - config_out_file = open(copy_config_path, "w") + config_out_file = open(copy_config_path, "w", encoding="utf-8") config_out_file.writelines(config_lines) config_out_file.close() # copy model stats file if available