Skip to content
Myr

A TextIOWrapper that wraps _winconsole._WindowsConsoleWriter expects a buffered stream.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

TextIOWrapper expects a *buffered* stream not an unbuffered one. It wont check how much data was written and will drop data if you don't write it all. This reproduces quite well on Python 3.6. Likely due to changes in TextIOWrapper.

authored by Segev Finer · committed by Segev Finer · parent 9bd66b3 · Browse files · 1 file+2 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Trailers

  • Fixes: #816

Diff stats

1 file+2 added−2 removed

  • other:+2 added−2 removed

1 file+2 added−2 removed

modified:click/_winconsole.py+2 added-2 removed
208 unmodified lines
209210211def _get_text_stdout(buffer_stream):212 text_stream = _NonClosingTextIOWrapper(213 _WindowsConsoleWriter(STDOUT_HANDLE),213 io.BufferedWriter(_WindowsConsoleWriter(STDOUT_HANDLE)),214 'utf-16-le', 'strict', line_buffering=True)215 return ConsoleStream(text_stream, buffer_stream)216217218def _get_text_stderr(buffer_stream):219 text_stream = _NonClosingTextIOWrapper(220 _WindowsConsoleWriter(STDERR_HANDLE),220 io.BufferedWriter(_WindowsConsoleWriter(STDERR_HANDLE)),221 'utf-16-le', 'strict', line_buffering=True)222 return ConsoleStream(text_stream, buffer_stream)223224
49 unmodified lines