Skip to content

Commit 576828d

Browse files
authored
Update base64.rst
1 parent 7016044 commit 576828d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Doc/library/base64.rst

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,11 @@ POST request.
7474
of length 2 which specifies the alternative alphabet used instead of the
7575
``+`` and ``/`` characters.
7676

77-
A :exc:`binascii.Error` exception is raised
78-
if *s* is incorrectly padded.
77+
A :exc:`binascii.Error` exception is raised if *s* contains incorrect padding.
78+
When *validate* is ``False`` (the default), extra padding characters and
79+
discontinuous padding characters (``=`` characters in the middle of the string)
80+
are silently ignored. When *validate* is ``True``, such incorrect padding
81+
will result in a :exc:`binascii.Error`.
7982

8083
If *validate* is ``False`` (the default), characters that are neither
8184
in the normal base-64 alphabet nor the alternative alphabet are
@@ -86,7 +89,6 @@ POST request.
8689
For more information about the strict base64 check, see :func:`binascii.a2b_base64`
8790

8891
May assert or raise a :exc:`ValueError` if the length of *altchars* is not 2.
89-
9092
.. function:: standard_b64encode(s)
9193

9294
Encode :term:`bytes-like object` *s* using the standard Base64 alphabet

0 commit comments

Comments
 (0)