Skip to content

Commit 3496086

Browse files
committed
add docs and changelog for #830
1 parent 6cafd32 commit 3496086

2 files changed

Lines changed: 13 additions & 2 deletions

File tree

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ Unreleased
8787
- Raw strings added so correct escaping occurs. (`#807`_)
8888
- Fix 16k character limit of ``click.echo`` on Windows. (`#816`_,
8989
`#819`_)
90+
- Overcome 64k character limit when writing to binary stream on
91+
Windows 7. (`#825`_, `#830`_)
9092
- Add bool conversion for "t" and "f". (`#842`_)
9193
- ``NoSuchOption`` errors take ``ctx`` so that ``--help`` hint gets
9294
printed in error output. (`#860`_)
@@ -212,6 +214,8 @@ Unreleased
212214
.. _#819: https://github.com/pallets/click/pull/819
213215
.. _#821: https://github.com/pallets/click/issues/821
214216
.. _#822: https://github.com/pallets/click/issues/822
217+
.. _#825: https://github.com/pallets/click/issues/825
218+
.. _#830: https://github.com/pallets/click/pull/830
215219
.. _#842: https://github.com/pallets/click/pull/842
216220
.. _#860: https://github.com/pallets/click/issues/860
217221
.. _#862: https://github.com/pallets/click/issues/862

docs/wincmd.rst

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,21 @@ This hackery is used on both Python 2 and Python 3 as neither version of
5959
Python has native support for cmd.exe with unicode characters. There are
6060
some limitations you need to be aware of:
6161

62-
* this unicode support is limited to ``click.echo``, ``click.prompt`` as
62+
* This unicode support is limited to ``click.echo``, ``click.prompt`` as
6363
well as ``click.get_text_stream``.
64-
* depending on if unicode values or byte strings are passed the control
64+
* Depending on if unicode values or byte strings are passed the control
6565
flow goes completely different places internally which can have some
6666
odd artifacts if data partially ends up being buffered. Click
6767
attempts to protect against that by manually always flushing but if
6868
you are mixing and matching different string types to ``stdout`` or
6969
``stderr`` you will need to manually flush.
70+
* The raw output stream is set to binary mode, which is a global
71+
operation on Windows, so ``print`` calls will be affected. Prefer
72+
``click.echo`` over ``print``.
73+
* On Windows 7 and below, there is a limitation where at most 64k
74+
characters can be written in one call in binary mode. In this
75+
situation, ``sys.stdout`` and ``sys.stderr`` are replaced with
76+
wrappers that work around the limitation.
7077

7178
Another important thing to note is that the Windows console's default
7279
fonts do not support a lot of characters which means that you are mostly

0 commit comments

Comments
 (0)