All strings are unicode in Python 3

This commit is contained in:
Alice Grey 2020-08-29 17:25:20 -05:00
parent 89156d51f3
commit a3a4202b00
1 changed files with 4 additions and 6 deletions

View File

@ -99,9 +99,7 @@ class KlipperPlugin(
filepath = os.path.expanduser(
self._settings.get(["configuration", "path"])
)
# Check for Unicode config file and convert to String, if so.
if type(data["config"]) == str:
data["config"] = data["config"].encode('utf-8')
data["config"] = data["config"].encode('utf-8')
f = open(filepath, "w")
f.write(data["config"])