Commit 4d265145 authored by Samuel GAIST's avatar Samuel GAIST
Browse files

[execution][base] Fix writing json in binary file

parent e5f00600
......@@ -361,7 +361,8 @@ class BaseExecutor(object):
data = convert_experiment_configuration_to_container(self.data)
with open(os.path.join(directory, 'configuration.json'), 'wb') as f:
simplejson.dump(data, f, indent=2)
json_data = simplejson.dumps(data, indent=2)
f.write(json_data.encode('utf-8'))
tmp_prefix = os.path.join(directory, 'prefix')
if not os.path.exists(tmp_prefix):
......@@ -374,7 +375,8 @@ class BaseExecutor(object):
"""Exports contents useful for a backend runner to run the algorithm"""
with open(os.path.join(directory, 'configuration.json'), 'wb') as f:
simplejson.dump(self.data, f, indent=2)
json_data = simplejson.dumps(self.data, indent=2)
f.write(json_data.encode('utf-8'))
tmp_prefix = os.path.join(directory, 'prefix')
if not os.path.exists(tmp_prefix): os.makedirs(tmp_prefix)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment