Skip to content

Commit

Permalink
馃悰 env needs to be native strings
Browse files Browse the repository at this point in the history
So, bytes under py2 and unicode under py3.

Closes #3428
  • Loading branch information
foosel committed Jan 20, 2020
1 parent 89b597a commit 4460c8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/octoprint/util/commandline.py
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit 4460c8b

Please sign in to comment.