From c56c34fa1c4c8bf7e10448804604edf600fdefa0 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sat, 9 Oct 2021 19:34:08 -0400 Subject: configfile: Use Python2's ConfigParser when running on Python2 The backport of Python3's configparser causes issues when there is unicode characters in the config file. To avoid introducing new errors, go back to using the Python2 version of ConfigParser when running on Python2. Signed-off-by: Kevin O'Connor --- klippy/util.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'klippy/util.py') diff --git a/klippy/util.py b/klippy/util.py index eabd2263..4f018b0f 100644 --- a/klippy/util.py +++ b/klippy/util.py @@ -98,7 +98,8 @@ def setup_python2_wrappers(): if sys.version_info.major >= 3: return # Add module hacks so that common Python3 module imports work in Python2 - import Queue, io, StringIO, time + import ConfigParser, Queue, io, StringIO, time + sys.modules["configparser"] = ConfigParser sys.modules["queue"] = Queue io.StringIO = StringIO.StringIO time.process_time = time.clock -- cgit v1.2.3-70-g09d2