Convert config file from unicode to string before writing, if necessary.
This commit is contained in:
parent
733b27a496
commit
31c8afcb9e
|
@ -92,6 +92,10 @@ class KlipperPlugin(
|
||||||
filepath = os.path.expanduser(
|
filepath = os.path.expanduser(
|
||||||
self._settings.get(["configuration", "path"])
|
self._settings.get(["configuration", "path"])
|
||||||
)
|
)
|
||||||
|
# Check for Unicode config file and convert to String, if so.
|
||||||
|
if type(data["config"]) == unicode:
|
||||||
|
data["config"] = data["config"].encode('utf-8')
|
||||||
|
|
||||||
f = open(filepath, "w")
|
f = open(filepath, "w")
|
||||||
f.write(data["config"])
|
f.write(data["config"])
|
||||||
f.close()
|
f.close()
|
||||||
|
|
Loading…
Reference in New Issue