Skip to content

Commit

Permalink
Merge pull request #819 from segevfiner/winconsole-writer-bug-2
Browse files Browse the repository at this point in the history
A TextIOWrapper that wraps _winconsole._WindowsConsoleWriter expects a buffered stream
  • Loading branch information
davidism authored Sep 13, 2018
2 parents 2cd71bf + dbd13dc commit 16792fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions click/_winconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ def _get_text_stdin(buffer_stream):

def _get_text_stdout(buffer_stream):
text_stream = _NonClosingTextIOWrapper(
_WindowsConsoleWriter(STDOUT_HANDLE),
io.BufferedWriter(_WindowsConsoleWriter(STDOUT_HANDLE)),
'utf-16-le', 'strict', line_buffering=True)
return ConsoleStream(text_stream, buffer_stream)


def _get_text_stderr(buffer_stream):
text_stream = _NonClosingTextIOWrapper(
_WindowsConsoleWriter(STDERR_HANDLE),
io.BufferedWriter(_WindowsConsoleWriter(STDERR_HANDLE)),
'utf-16-le', 'strict', line_buffering=True)
return ConsoleStream(text_stream, buffer_stream)

Expand Down

0 comments on commit 16792fe

Please sign in to comment.