From 4460c8bee04dc1751f3f1f41876f63a058e41e5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Mon, 20 Jan 2020 13:36:02 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20env=20needs=20to=20be=20native?= =?UTF-8?q?=20strings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit So, bytes under py2 and unicode under py3. Closes #3428 --- src/octoprint/util/commandline.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/octoprint/util/commandline.py b/src/octoprint/util/commandline.py index 19dd7a0b35..d06ef5a366 100644 --- a/src/octoprint/util/commandline.py +++ b/src/octoprint/util/commandline.py @@ -11,7 +11,7 @@ import re import time -from . import to_unicode, to_bytes +from . import to_unicode, to_native_str from .platform import get_os from past.builtins import unicode @@ -172,7 +172,7 @@ def call(self, command, **kwargs): # if we are running under windows, make sure there are no unicode strings in the env if get_os() == "windows" and "env" in kwargs: - kwargs["env"] = dict((k, to_bytes(v)) for k, v in kwargs["env"].items()) + kwargs["env"] = dict((k, to_native_str(v)) for k, v in kwargs["env"].items()) delimiter = kwargs.get("delimiter", b'\n') try: