Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Félix Hartmann
XyDyS
Commits
15e4cb11
Commit
15e4cb11
authored
Sep 29, 2017
by
Félix Hartmann
Browse files
[bugfix] Remove 'encoding' param in json.dumps to make it work for both
Python 2 and 3.
parent
d2c5ccf7
Changes
1
Hide whitespace changes
Inline
Side-by-side
controlpanel.py
View file @
15e4cb11
...
...
@@ -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.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment