Skip to content

Commit

Permalink
Remove unicode conversion (#11)
Browse files Browse the repository at this point in the history
Fixes issue #9 but keeps unicode conversion for python2 users.
  • Loading branch information
AliceGrey authored Sep 27, 2020
1 parent a2291b1 commit dbf64fa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion octoprint_klipper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import octoprint.plugin.core
import glob
import os
import sys
from octoprint.util.comm import parse_firmware_line
from .modules import KlipperLogAnalyzer
import flask
Expand Down Expand Up @@ -100,7 +101,8 @@ def on_settings_save(self, data):
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"])
Expand Down

0 comments on commit dbf64fa

Please sign in to comment.