Merge branch 'master' of github.com:mitsuhiko/click
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by Armin Ronacher · committed by Armin Ronacher · parents b62057d, abe99ca · Browse files · 1 file·+8 added−9 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+8 added−9 removed
- other:+8 added−9 removed
Provenance
- Commit
fe262a9- Tree
5d6f1aa- Author
Armin Ronacher <armin.ronacher@active-4.com>- Committer
Armin Ronacher <armin.ronacher@active-4.com>- Parent 1
b62057d- Parent 2
abe99ca
1 file changed+8 added−9 removed
modified:docs/python3.rst+8 added-9 removed
23 unmodified lines24 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 not be fixed in Click itself!28+ surrogate escapes. This will not be fixed in click itself!29 30 For more information see :ref:`python3-surrogates`.31 32 * Standard input and output on Python 3 is opened in unicode mode by62 unmodified lines95 Python 3 Surrogate Handling96 ---------------------------97 98 Click on Python 3 does all the unicode handling in the standard library99-and is subject to it's behavior. On Python 2 click does all the unicode99+and is subject to its behavior. On Python 2 click does all the unicode100 handling itself which means there are differences in error behavior.101 102-The most glaring difference is that on Python 2 Unicode will "just work"102+The most glaring difference is that on Python 2 unicode will "just work"103 but requires extra care on Python 3. The reason for this is that on104 Python 3 the encoding detection is done in the interpreter and on Linux105-and certain other operating systems it's encoding handling is problematic.105+and certain other operating systems its encoding handling is problematic.106 107 The biggest source of frustration there is that click scripts invoked by108 init systems (sysvinit, upstart, systemd, etc.), deployment tools (salt,109-puppet) or cronjobs (cron) will refuse to work unless a unicode locale is109+puppet) or cron jobs (cron) will refuse to work unless a unicode locale is110 exported.111 112 If click encounters such an environment it will prevent further execution113-to force you to force a locale. This is done because click cannot know113+to force you to set a locale. This is done because click cannot know114 about the state of the system once it's invoked and restore the values115 before Python's unicode handling kicked in.116 117 If you see something like this error on Python 3::14 unmodified lines132 133 export LC_ALL=de_DE.utf-8134 export LANG=de_DE.utf-8135 136-If you are on an american machine ``en_EN.utf-8`` is the encoding of137-choice. On some newer linux systems you can also try ``C.UTF-8`` as138-locale::136+If you are on a US machine, ``en_EN.utf-8`` is the encoding of choice. On137+some newer linux systems you can also try ``C.UTF-8`` as locale::138 139 export LC_ALL=C.UTF-8140 export LANG=C.UTF-8141 10 unmodified lines