Skip to content
Myr

Merge branch '4.x-maintenance'

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

authored by Markus Unterwaditzer · committed by Markus Unterwaditzer · parents 6b1f11d, 4592098 · Browse files · 3 files+9 added−1 removed
This commit

State

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

Diff stats

3 files+9 added−1 removed

  • tests:+7 added−0 removed
  • other:+2 added−1 removed

3 files+9 added−1 removed

modified:click/utils.py+1 added-1 removed
297 unmodified lines
298299 if message:300 file.write(message)301 if nl:302 file.write('\n')302 file.write(u'\n')303 file.flush()304305306def get_binary_stream(name):
131 unmodified lines
modified:tests/test_utils.py+7 added
38 unmodified lines
39 click.echo(bytearray(b'\x1b[31mx\x1b[39m'), nl=False)40 assert out.getvalue() == b'\x1b[31mx\x1b[39m'414243def test_echo_custom_file():44 import io45 f = io.StringIO()46 click.echo(u'hello', file=f)47 assert f.getvalue() == u'hello\n'484950def test_styling():51 examples = [52 ('x', dict(fg='black'), '\x1b[30mx\x1b[0m'),53 ('x', dict(fg='red'), '\x1b[31mx\x1b[0m'),
204 unmodified lines
modified:CHANGES+1 added
24 unmodified lines
25- Support streams with encoding set to `None` on Python 3 by barfing with26 a better error.27- Handle ^C in less-pager properly.28- Handle return value of `None` from `sys.getfilesystemencoding`29- Fix crash when writing to unicode files with `click.echo`.3031Version 4.032-----------33
207 unmodified lines