forked from platformio/platformio-core
Force PIPE reader to UTF-8 on Windows // Issue #3417
This commit is contained in:
@@ -20,6 +20,7 @@ from threading import Thread
|
|||||||
|
|
||||||
from platformio import exception
|
from platformio import exception
|
||||||
from platformio.compat import (
|
from platformio.compat import (
|
||||||
|
PY2,
|
||||||
WINDOWS,
|
WINDOWS,
|
||||||
get_filesystem_encoding,
|
get_filesystem_encoding,
|
||||||
get_locale_encoding,
|
get_locale_encoding,
|
||||||
@@ -30,7 +31,10 @@ from platformio.compat import (
|
|||||||
class AsyncPipeBase(object):
|
class AsyncPipeBase(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self._fd_read, self._fd_write = os.pipe()
|
self._fd_read, self._fd_write = os.pipe()
|
||||||
|
if PY2:
|
||||||
self._pipe_reader = os.fdopen(self._fd_read)
|
self._pipe_reader = os.fdopen(self._fd_read)
|
||||||
|
else:
|
||||||
|
self._pipe_reader = os.fdopen(self._fd_read, encoding="utf-8")
|
||||||
self._buffer = ""
|
self._buffer = ""
|
||||||
self._thread = Thread(target=self.run)
|
self._thread = Thread(target=self.run)
|
||||||
self._thread.start()
|
self._thread.start()
|
||||||
|
Reference in New Issue
Block a user