Remove unicode conversion (#11)

Fixes issue #9 but keeps unicode conversion for python2 users.
This commit is contained in:
Alice 2020-09-27 16:46:47 -05:00 committed by GitHub
parent a2291b1a3d
commit dbf64faee8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -19,6 +19,7 @@ import octoprint.plugin
import octoprint.plugin.core
import glob
import os
import sys
from octoprint.util.comm import parse_firmware_line
from .modules import KlipperLogAnalyzer
import flask
@ -100,7 +101,8 @@ class KlipperPlugin(
filepath = os.path.expanduser(
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.write(data["config"])