Skip to content

Commit

Permalink
Force PIPE reader to UTF-8 on Windows // Issue #3417
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Mar 21, 2020
1 parent dbeaaf2 commit efd3b24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion platformio/proc.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

from platformio import exception
from platformio.compat import (
PY2,
WINDOWS,
get_filesystem_encoding,
get_locale_encoding,
Expand All @@ -30,7 +31,10 @@
class AsyncPipeBase(object):
def __init__(self):
self._fd_read, self._fd_write = os.pipe()
self._pipe_reader = os.fdopen(self._fd_read)
if PY2:
self._pipe_reader = os.fdopen(self._fd_read)
else:
self._pipe_reader = os.fdopen(self._fd_read, encoding="utf-8")
self._buffer = ""
self._thread = Thread(target=self.run)
self._thread.start()
Expand Down

0 comments on commit efd3b24

Please sign in to comment.