From e8a55a61f7156e53384b00bb6ce31879a6de5d84 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Musil?= Date: Wed, 28 Jun 2017 16:18:25 +0200 Subject: [PATCH] bugfix --- neuralmonkey/learning_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/neuralmonkey/learning_utils.py b/neuralmonkey/learning_utils.py index 719d8d5c3..07cbdfc3e 100644 --- a/neuralmonkey/learning_utils.py +++ b/neuralmonkey/learning_utils.py @@ -2,6 +2,7 @@ # pylint: disable=too-many-lines # There are too many lines because of these pylint directives. +import codecs from typing import Any, Callable, Dict, List, Tuple, Optional, Union, Iterable import os import numpy as np @@ -342,7 +343,7 @@ def run_on_dataset(tf_manager: TensorFlowManager, np.save(path, data) log('Result saved as numpy array to "{}"'.format(path)) else: - with open(path, 'w') as f_out: + with codecs.open(path, 'w', 'utf-8') as f_out: f_out.writelines( [" ".join(sent) + "\n" for sent in data]) log("Result saved as plain text \"{}\"".format(path))