FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-73613: clarify padding= docs in for base64 & binascii modules by gpshead · Pull Request #148183 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .rst  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
13 changes: 9 additions & 4 deletions Doc/library/base64.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ POST request.

If *padded* is true, the last group of 4 base 64 alphabet characters must
be padded with the '=' character.
If *padded* is false, the '=' character is treated as other non-alphabet
characters (depending on the value of *validate* and *ignorechars*).
If *padded* is false, padding is neither required nor recognized:
the '=' character is not treated as padding but as a non-alphabet
character, which means it is silently discarded when *validate* is false,
or causes an :exc:`~binascii.Error` when *validate* is true unless
b'=' is included in *ignorechars*.

A :exc:`binascii.Error` exception is raised
if *s* is incorrectly padded.
Expand Down Expand Up @@ -194,8 +197,10 @@ POST request.

If *padded* is true, the last group of 8 base 32 alphabet characters must
be padded with the '=' character.
If *padded* is false, the '=' character is treated as other non-alphabet
characters (depending on the value of *ignorechars*).
If *padded* is false, padding is neither required nor recognized:
the '=' character is not treated as padding but as a non-alphabet
character, which means it raises an :exc:`~binascii.Error` unless
b'=' is included in *ignorechars*.

*ignorechars* should be a :term:`bytes-like object` containing characters
to ignore from the input.
Expand Down
7 changes: 5 additions & 2 deletions Doc/library/binascii.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,11 @@ The :mod:`!binascii` module defines the following functions:

If *padded* is true, the last group of 4 base 64 alphabet characters must
be padded with the '=' character.
If *padded* is false, the '=' character is treated as other non-alphabet
characters (depending on the value of *strict_mode* and *ignorechars*).
If *padded* is false, padding is neither required nor recognized:
the '=' character is not treated as padding but as a non-alphabet
character, which means it is silently discarded when *strict_mode* is false,
or causes an :exc:`~binascii.Error` when *strict_mode* is true unless
b'=' is included in *ignorechars*.

If *ignorechars* is specified, it should be a :term:`bytes-like object`
containing characters to ignore from the input when *strict_mode* is true.
Expand Down
Loading

Back | FazBrowse Home | New Git URL