mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Use file system encoding when decoding subprocess output // Resolve #2890
This commit is contained in:
@ -19,7 +19,7 @@ from os.path import isdir, isfile, join, normpath
|
||||
from threading import Thread
|
||||
|
||||
from platformio import exception
|
||||
from platformio.compat import WINDOWS, string_types
|
||||
from platformio.compat import WINDOWS, get_filesystem_encoding, string_types
|
||||
|
||||
|
||||
class AsyncPipeBase(object):
|
||||
@ -122,7 +122,7 @@ def exec_command(*args, **kwargs):
|
||||
for k, v in result.items():
|
||||
if isinstance(result[k], bytes):
|
||||
try:
|
||||
result[k] = result[k].decode(sys.getdefaultencoding())
|
||||
result[k] = result[k].decode(get_filesystem_encoding())
|
||||
except UnicodeDecodeError:
|
||||
result[k] = result[k].decode("latin-1")
|
||||
if v and isinstance(v, string_types):
|
||||
|
Reference in New Issue
Block a user