Remove unicode conversion (#11)
Fixes issue #9 but keeps unicode conversion for python2 users.
This commit is contained in:
parent
a2291b1a3d
commit
dbf64faee8
|
@ -19,6 +19,7 @@ import octoprint.plugin
|
||||||
import octoprint.plugin.core
|
import octoprint.plugin.core
|
||||||
import glob
|
import glob
|
||||||
import os
|
import os
|
||||||
|
import sys
|
||||||
from octoprint.util.comm import parse_firmware_line
|
from octoprint.util.comm import parse_firmware_line
|
||||||
from .modules import KlipperLogAnalyzer
|
from .modules import KlipperLogAnalyzer
|
||||||
import flask
|
import flask
|
||||||
|
@ -100,7 +101,8 @@ class KlipperPlugin(
|
||||||
filepath = os.path.expanduser(
|
filepath = os.path.expanduser(
|
||||||
self._settings.get(["configuration", "configpath"])
|
self._settings.get(["configuration", "configpath"])
|
||||||
)
|
)
|
||||||
data["config"] = data["config"].encode('utf-8')
|
if sys.version_info[0] < 3:
|
||||||
|
data["config"] = data["config"].encode('utf-8')
|
||||||
|
|
||||||
f = open(filepath, "w")
|
f = open(filepath, "w")
|
||||||
f.write(data["config"])
|
f.write(data["config"])
|
||||||
|
|
Loading…
Reference in New Issue