Skip to content

Commit 99c0bda

Browse files
authored
PEP 538: Fix footnotes (#2714)
1 parent 3a792e4 commit 99c0bda

File tree

1 file changed

+28
-38
lines changed

1 file changed

+28
-38
lines changed

pep-0538.txt

Lines changed: 28 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ can cause problems in some situations (for example, when using the GNU readline
124124
module [16_]).
125125

126126
On non-Apple and non-Android \*nix systems, these operations are handled using
127-
the C locale system in glibc, which has the following characteristics [4_]:
127+
the C locale system in glibc, which has the following characteristics [4]_:
128128

129129
* by default, all processes start in the ``C`` locale, which uses ``ASCII``
130130
for these conversions. This is almost never what anyone doing multilingual
@@ -136,7 +136,7 @@ the C locale system in glibc, which has the following characteristics [4_]:
136136

137137
The specific locale category that covers the APIs that CPython depends on is
138138
``LC_CTYPE``, which applies to "classification and conversion of characters,
139-
and to multibyte and wide characters" [5_]. Accordingly, CPython includes the
139+
and to multibyte and wide characters" [5]_. Accordingly, CPython includes the
140140
following key calls to ``setlocale``:
141141

142142
* in the main ``python`` binary, CPython calls ``setlocale(LC_ALL, "")`` to
@@ -183,7 +183,7 @@ Mac OS X and other \*BSD systems have taken a different approach: instead of
183183
offering a ``C.UTF-8`` locale, they offer a partial ``UTF-8`` locale that only
184184
defines the ``LC_CTYPE`` category. On such systems, the preferred
185185
environmental locale adjustment is to set ``LC_CTYPE=UTF-8`` rather than to set
186-
``LC_ALL`` or ``LANG``. [17_]
186+
``LC_ALL`` or ``LANG``. [17]_
187187

188188
In the specific case of Docker containers and similar technologies, the
189189
appropriate locale setting can be specified directly in the container image
@@ -247,8 +247,8 @@ Motivation
247247
While Linux container technologies like Docker, Kubernetes, and OpenShift are
248248
best known for their use in web service development, the related container
249249
formats and execution models are also being adopted for Linux command line
250-
application development. Technologies like Gnome Flatpak [7_] and
251-
Ubuntu Snappy [8_] further aim to bring these same techniques to Linux GUI
250+
application development. Technologies like Gnome Flatpak [7]_ and
251+
Ubuntu Snappy [8]_ further aim to bring these same techniques to Linux GUI
252252
application development.
253253

254254
When using Python 3 for application development in these contexts, it isn't
@@ -327,7 +327,7 @@ with this problem automatically rather than relying on redistributors or end
327327
users to handle it through system configuration changes.
328328

329329
While the glibc developers are working towards making the C.UTF-8 locale
330-
universally available for use by glibc based applications like CPython [6_],
330+
universally available for use by glibc based applications like CPython [6]_,
331331
this unfortunately doesn't help on platforms that ship older versions of glibc
332332
without that feature, and also don't provide C.UTF-8 (or an equivalent) as an
333333
on-disk locale the way Debian and Fedora do. These platforms are considered
@@ -649,7 +649,7 @@ Defaulting to "surrogateescape" error handling on the standard IO streams
649649
By coercing the locale away from the legacy C default and its assumption of
650650
ASCII as the preferred text encoding, this PEP also disables the implicit use
651651
of the "surrogateescape" error handler on the standard IO streams that was
652-
introduced in Python 3.5 ([15_]), as well as the automatic use of
652+
introduced in Python 3.5 ([15]_), as well as the automatic use of
653653
``surrogateescape`` when operating in :pep:`540`'s proposed UTF-8 mode.
654654

655655
Rather than introducing yet another configuration option to adjust that
@@ -662,7 +662,7 @@ provided text values are typically able to be transparently passed through a
662662
Python 3 application even if it is incorrect in assuming that that text has
663663
been encoded as UTF-8.
664664

665-
In particular, GB 18030 [12_] is a Chinese national text encoding standard
665+
In particular, GB 18030 [12]_ is a Chinese national text encoding standard
666666
that handles all Unicode code points, that is formally incompatible with both
667667
ASCII and UTF-8, but will nevertheless often tolerate processing as surrogate
668668
escaped data - the points where GB 18030 reuses ASCII byte values in an
@@ -672,7 +672,7 @@ the relevant ASCII code points. Operations that don't involve splitting on or
672672
searching for particular ASCII or Unicode code point values are almost
673673
certain to work correctly.
674674

675-
Similarly, Shift-JIS [13_] and ISO-2022-JP [14_] remain in widespread use in
675+
Similarly, Shift-JIS [13]_ and ISO-2022-JP [14]_ remain in widespread use in
676676
Japan, and are incompatible with both ASCII and UTF-8, but will tolerate text
677677
processing operations that don't involve splitting on or searching for
678678
particular ASCII or Unicode code point values.
@@ -908,7 +908,7 @@ This was later removed on the grounds that setting only ``LC_CTYPE`` is
908908
sufficient to handle all of the problematic scenarios that the PEP aimed
909909
to resolve, while setting ``LANG`` as well would break cases where ``LANG``
910910
was set correctly, and the locale problems were solely due to an incorrect
911-
``LC_CTYPE`` setting ([22_]).
911+
``LC_CTYPE`` setting ([22]_).
912912

913913
For example, consider a Python application that called the Linux ``date``
914914
utility in a subprocess rather than doing its own date formatting::
@@ -1077,7 +1077,7 @@ be entirely redundant.
10771077
However, that assumption turned out to be incorrect, as subsequent
10781078
investigations showed that if you explicitly configure ``LANG=C`` on
10791079
these platforms, extension modules like GNU readline will misbehave in much the
1080-
same way as they do on other \*nix systems. [21_]
1080+
same way as they do on other \*nix systems. [21]_
10811081

10821082
In addition, Mac OS X is also frequently used as a development and testing
10831083
platform for Python software intended for deployment to other \*nix environments
@@ -1093,12 +1093,12 @@ Implementation
10931093
==============
10941094

10951095
The reference implementation is being developed in the
1096-
``pep538-coerce-c-locale`` feature branch [18_] in Nick Coghlan's fork of the
1097-
CPython repository on GitHub. A work-in-progress PR is available at [20_].
1096+
``pep538-coerce-c-locale`` feature branch [18]_ in Nick Coghlan's fork of the
1097+
CPython repository on GitHub. A work-in-progress PR is available at [20]_.
10981098

10991099
This reference implementation covers not only the enhancement request in
1100-
issue 28180 [1_], but also the Android compatibility fixes needed to resolve
1101-
issue 28997 [16_].
1100+
issue 28180 [1]_, but also the Android compatibility fixes needed to resolve
1101+
issue 28997 [16]_.
11021102

11031103

11041104
Backporting to earlier Python 3 releases
@@ -1115,7 +1115,7 @@ default, or else specifically for platforms where such a locale is already
11151115
consistently available.
11161116

11171117
At least the Fedora project is planning to pursue this approach for the
1118-
upcoming Fedora 26 release [19_].
1118+
upcoming Fedora 26 release [19]_.
11191119

11201120

11211121
Backporting to other 3.x releases
@@ -1139,7 +1139,7 @@ Acknowledgements
11391139

11401140
The locale coercion approach proposed in this PEP is inspired directly by
11411141
Armin Ronacher's handling of this problem in the ``click`` command line
1142-
utility development framework [2_]::
1142+
utility development framework [2]_::
11431143

11441144
$ LANG=C python3 -c 'import click; cli = click.command()(lambda:None); cli()'
11451145
Traceback (most recent call last):
@@ -1157,18 +1157,18 @@ utility development framework [2_]::
11571157
export LANG=C.UTF-8
11581158

11591159
The change was originally proposed as a downstream patch for Fedora's
1160-
system Python 3.6 package [3_], and then reformulated as a PEP for Python 3.7
1160+
system Python 3.6 package [3]_, and then reformulated as a PEP for Python 3.7
11611161
with a section allowing for backports to earlier versions by redistributors.
11621162
In parallel with the development of the upstream patch, Charalampos Stratakis
11631163
has been working on the Fedora 26 backport and providing feedback on the
11641164
practical viability of the proposed changes.
11651165

1166-
The initial draft was posted to the Python Linux SIG for discussion [10_] and
1166+
The initial draft was posted to the Python Linux SIG for discussion [10]_ and
11671167
then amended based on both that discussion and Victor Stinner's work in
1168-
:pep:`540` [11_].
1168+
:pep:`540` [11]_.
11691169

11701170
The "ℙƴ☂ℌøἤ" string used in the Unicode handling examples throughout this PEP
1171-
is taken from Ned Batchelder's excellent "Pragmatic Unicode" presentation [9_].
1171+
is taken from Ned Batchelder's excellent "Pragmatic Unicode" presentation [9]_.
11721172

11731173
Stephen Turnbull has long provided valuable insight into the text encoding
11741174
handling challenges he regularly encounters at the University of Tsukuba
@@ -1179,16 +1179,16 @@ References
11791179
==========
11801180

11811181
.. [1] CPython: sys.getfilesystemencoding() should default to utf-8
1182-
(http://bugs.python.org/issue28180)
1182+
(https://bugs.python.org/issue28180)
11831183

11841184
.. [2] Locale configuration required for click applications under Python 3
1185-
(http://click.pocoo.org/5/python3/#python-3-surrogate-handling)
1185+
(https://click.palletsprojects.com/en/5.x/python3/#python-3-surrogate-handling)
11861186

11871187
.. [3] Fedora: force C.UTF-8 when Python 3 is run under the C locale
11881188
(https://bugzilla.redhat.com/show_bug.cgi?id=1404918)
11891189

11901190
.. [4] GNU C: How Programs Set the Locale
1191-
( https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html)
1191+
(https://www.gnu.org/software/libc/manual/html_node/Setting-the-Locale.html)
11921192

11931193
.. [5] GNU C: Locale Categories
11941194
(https://www.gnu.org/software/libc/manual/html_node/Locale-Categories.html)
@@ -1197,13 +1197,13 @@ References
11971197
(https://sourceware.org/glibc/wiki/Proposals/C.UTF-8)
11981198

11991199
.. [7] GNOME Flatpak
1200-
(http://flatpak.org/)
1200+
(https://flatpak.org/)
12011201

12021202
.. [8] Ubuntu Snappy
12031203
(https://www.ubuntu.com/desktop/snappy)
12041204

12051205
.. [9] Pragmatic Unicode
1206-
(http://nedbatchelder.com/text/unipain.html)
1206+
(https://nedbatchelder.com/text/unipain.html)
12071207

12081208
.. [10] linux-sig discussion of initial PEP draft
12091209
(https://mail.python.org/pipermail/linux-sig/2017-January/000014.html)
@@ -1224,10 +1224,10 @@ References
12241224
(https://bugs.python.org/issue19977)
12251225

12261226
.. [16] test_readline.test_nonascii fails on Android
1227-
(http://bugs.python.org/issue28997)
1227+
(https://bugs.python.org/issue28997)
12281228

12291229
.. [17] UTF-8 locale discussion on "locale.getdefaultlocale() fails on Mac OS X with default language set to English"
1230-
(http://bugs.python.org/issue18378#msg215215)
1230+
(https://bugs.python.org/issue18378#msg215215)
12311231

12321232
.. [18] GitHub branch diff for ``ncoghlan:pep538-coerce-c-locale``
12331233
(https://github.com/python/cpython/compare/master...ncoghlan:pep538-coerce-c-locale)
@@ -1250,13 +1250,3 @@ Copyright
12501250

12511251
This document has been placed in the public domain under the terms of the
12521252
CC0 1.0 license: https://creativecommons.org/publicdomain/zero/1.0/
1253-
1254-
1255-
..
1256-
Local Variables:
1257-
mode: indented-text
1258-
indent-tabs-mode: nil
1259-
sentence-end-double-space: t
1260-
fill-column: 70
1261-
coding: utf-8
1262-
End:

0 commit comments

Comments
 (0)