Skip to content

Commit 1146806

Browse files
committed
Define "canonical" locally for ascii85/base85 docs
The PLRM (Adobe Ascii85) and the various base85 alphabets do not define a "canonical" form. Where the underlying spec doesn't ground the term, the doc text now says explicitly that "canonical" here means "the encoding the corresponding b2a_* function would produce." Base16/32/64 entries are unchanged: RFC 4648 grounds the term there.
1 parent 00fb6fc commit 1146806

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

Doc/library/binascii.rst

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,10 @@ The :mod:`!binascii` module defines the following functions:
141141
This should only contain whitespace characters.
142142

143143
If *canonical* is true, non-canonical encodings are rejected with
144-
:exc:`binascii.Error`. This enforces that the ``z`` abbreviation is used
145-
for all-zero groups (rather than ``!!!!!``), and that partial final groups
146-
use the same padding digits the encoder would produce.
144+
:exc:`binascii.Error`. Here "canonical" means the encoding that
145+
:func:`b2a_ascii85` would produce: the ``z`` abbreviation must be used
146+
for all-zero groups (rather than ``!!!!!``), and partial final groups
147+
must use the same padding digits as the encoder.
147148

148149
Invalid Ascii85 data will raise :exc:`binascii.Error`.
149150

@@ -190,9 +191,10 @@ The :mod:`!binascii` module defines the following functions:
190191
*ignorechars* should be a :term:`bytes-like object` containing characters
191192
to ignore from the input.
192193

193-
If *canonical* is true, non-canonical encodings in partial final groups
194-
are rejected with :exc:`binascii.Error`. This enforces that the padding
195-
digits match what the encoder would produce.
194+
If *canonical* is true, non-canonical encodings are rejected with
195+
:exc:`binascii.Error`. Here "canonical" means the encoding that
196+
:func:`b2a_base85` would produce: partial final groups must use the
197+
same padding digits as the encoder.
196198

197199
Invalid Base85 data will raise :exc:`binascii.Error`.
198200

0 commit comments

Comments
 (0)