summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorXiang Zhang <angwerzx@126.com>2017-05-03 03:16:21 (GMT)
committerGitHub <noreply@github.com>2017-05-03 03:16:21 (GMT)
commit13f1f423fac39f8f14a3ce919dd236975517d5c6 (patch)
tree674546ddbbbfaf930c0087eeb1621fab11e25d5f /Doc
parent0360a9d015ddbc4e3d58e3ab4b433da27bf1db3a (diff)
downloadcpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.zip
cpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.tar.gz
cpython-13f1f423fac39f8f14a3ce919dd236975517d5c6.tar.bz2
bpo-30103: Allow Uuencode in Python using backtick as zero instead of space (#1326)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/binascii.rst9
-rw-r--r--Doc/library/uu.rst8
-rw-r--r--Doc/tools/susp-ignored.csv4
-rw-r--r--Doc/whatsnew/3.7.rst14
4 files changed, 30 insertions, 5 deletions
diff --git a/Doc/library/binascii.rst b/Doc/library/binascii.rst
index 0476f50..4d3d0e0 100644
--- a/Doc/library/binascii.rst
+++ b/Doc/library/binascii.rst
@@ -40,11 +40,14 @@ The :mod:`binascii` module defines the following functions:
data may be followed by whitespace.
-.. function:: b2a_uu(data)
+.. function:: b2a_uu(data, *, backtick=False)
Convert binary data to a line of ASCII characters, the return value is the
converted line, including a newline char. The length of *data* should be at most
- 45.
+ 45. If *backtick* is true, zeros are represented by ``'`'`` instead of spaces.
+
+ .. versionchanged:: 3.7
+ Added the *backtick* parameter.
.. function:: a2b_base64(string)
@@ -53,7 +56,7 @@ The :mod:`binascii` module defines the following functions:
than one line may be passed at a time.
-.. function:: b2a_base64(data, \*, newline=True)
+.. function:: b2a_base64(data, *, newline=True)
Convert binary data to a line of ASCII characters in base64 coding. The return
value is the converted line, including a newline char if *newline* is
diff --git a/Doc/library/uu.rst b/Doc/library/uu.rst
index 33fb36d..0bc8021 100644
--- a/Doc/library/uu.rst
+++ b/Doc/library/uu.rst
@@ -28,12 +28,16 @@ This code was contributed by Lance Ellinghouse, and modified by Jack Jansen.
The :mod:`uu` module defines the following functions:
-.. function:: encode(in_file, out_file, name=None, mode=None)
+.. function:: encode(in_file, out_file, name=None, mode=None, *, backtick=False)
Uuencode file *in_file* into file *out_file*. The uuencoded file will have
the header specifying *name* and *mode* as the defaults for the results of
decoding the file. The default defaults are taken from *in_file*, or ``'-'``
- and ``0o666`` respectively.
+ and ``0o666`` respectively. If *backtick* is true, zeros are represented by
+ ``'`'`` instead of spaces.
+
+ .. versionchanged:: 3.7
+ Added the *backtick* parameter.
.. function:: decode(in_file, out_file=None, mode=None, quiet=False)
diff --git a/Doc/tools/susp-ignored.csv b/Doc/tools/susp-ignored.csv
index 01b1d98..ef11b68 100644
--- a/Doc/tools/susp-ignored.csv
+++ b/Doc/tools/susp-ignored.csv
@@ -328,3 +328,7 @@ whatsnew/3.5,,:exception,ERROR:root:exception
whatsnew/changelog,,:version,import sys; I = version[:version.index(' ')]
whatsnew/changelog,,`,"for readability (was ""`"")."
whatsnew/changelog,,:end,str[start:end]
+library/binascii,,`,'`'
+library/uu,,`,'`'
+whatsnew/3.7,,`,'`'
+whatsnew/changelog,,`,'`'
diff --git a/Doc/whatsnew/3.7.rst b/Doc/whatsnew/3.7.rst
index cb0086c..7edf4fc 100644
--- a/Doc/whatsnew/3.7.rst
+++ b/Doc/whatsnew/3.7.rst
@@ -95,6 +95,13 @@ New Modules
Improved Modules
================
+binascii
+--------
+
+The :func:`~binascii.b2a_uu` function now accepts an optional *backtick*
+keyword argument. When it's true, zeros are represented by ``'`'``
+instead of spaces. (Contributed by Xiang Zhang in :issue:`30103`.)
+
contextlib
----------
@@ -159,6 +166,13 @@ urllib.parse
adding `~` to the set of characters that is never quoted by default.
(Contributed by Christian Theune and Ratnadeep Debnath in :issue:`16285`.)
+uu
+--
+
+Function :func:`~uu.encode` now accepts an optional *backtick*
+keyword argument. When it's true, zeros are represented by ``'`'``
+instead of spaces. (Contributed by Xiang Zhang in :issue:`30103`.)
+
Optimizations
=============