A couple drive-by edits to the Python 2/3 docs
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Erik Rose · committed by Erik Rose · parent c0536c9 · Browse files · 1 file·+6 added−6 removed
This commit
State
Before adoption: this commit came in with the history the project adopted, so no landing records it.
Diff stats
1 file+6 added−6 removed
- other:+6 added−6 removed
Provenance
- Commit
7503e66- Tree
514364a- Author
Erik Rose <grinch@grinchcentral.com>- Committer
Erik Rose <grinch@grinchcentral.com>- Parent
c0536c9
1 file changed+6 added−6 removed
modified:docs/python3.rst+6 added-6 removed
17 unmodified lines18 19 At the moment click suffers from a few problems on Python 3:20 21 * The command line in Unix traditionally is in bytes and not unicode.22- While there are encoding hits for all of this, there are generally22+ While there are encoding hints for all of this, there are generally23 some situations where this can break. The most common one is SSH24 connections to machines with different locales.25 26 Misconfigured environments can currently cause a wide range of unicode27 problems on Python 3 due to the lack of support for roundtripping28- surrogate escapes. This will be fixed on a case by case basis going28+ surrogate escapes. This will be fixed on a case-by-case basis going29 forward.30 31 * Standard input and output on Python 3 is opened in unicode mode by32 default. Click has to reopen the stream in binary mode in certain33 situations. Because there is no standardized way to do this, this34 might not always work. Primarily this can become a problem when35- testing command line applications.35+ testing command-line applications.36 37 This is not supported::38 39 sys.stdin = io.StringIO('Input here')33 unmodified lines73 74 On Python 3 the following is true:75 76 * ``sys.stdin``, ``sys.stdout`` and ``sys.stderr`` are by default77- text-based. When click needs a binary stream it attempts to discover77+ text-based. When click needs a binary stream, it attempts to discover78 the underlying binary stream. See :ref:`python3-limitations` for how79 this works.80 * ``sys.argv`` is always unicode-based. This also means that the native81 type for input values to the types in click is unicode and not bytes.82 83 This causes problems when the terminal is incorrectly set and Python84 does not figure out the encoding. In that case the unicode string85 will contain error bytes encoded as surrogate escapes.86-* When dealing with files click will always use the unicode file system86+* When dealing with files, click will always use the unicode file system87 API calls by using the operating system's reported or guessed88- filesystem encoding. Surrogates are supported for filenames so it88+ filesystem encoding. Surrogates are supported for filenames, so it89 should be possible to open files through the :class:`File` type even90 if the environment is misconfigured.