Commit 15e4cb11 authored by Félix Hartmann's avatar Félix Hartmann
Browse files

[bugfix] Remove 'encoding' param in json.dumps to make it work for both

Python 2 and 3.
parent d2c5ccf7
......@@ -329,8 +329,10 @@ class ControlPanel(HasTraits):
def save_to_file(self, file_name):
"""Save current settings into a configuration file."""
with open(file_name, 'w') as f:
json.dump(self, f, indent=4, encoding='utf-8',
default=self.json_codec.coder)
json.dump(self, f, indent=4, default=self.json_codec.coder)
# In Python 2.x, the 'encoding' param defaults to 'utf-8'.
# In Python 3.x, the 'encoding' param does not exist anylonger.
# Ergo, I removed "encoding='utf-8'" from json.dumps call.
def _load_settings_fired(self):
"""Callback of the "load settings" button.
......
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