[docs] base64 "legacy" functions violate RFC 3548 (issue 1753718)
vadmium+py at gmail.com
vadmium+py at gmail.com
Sun Dec 13 21:39:33 EST 2015
Mainly comments about data types accepted. Previous comment was made
before I noticed the new patch.
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst
File Doc/library/base64.rst (right):
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode30
Doc/library/base64.rst:30: In addition to the above, the legacy
interface also provides for encoding and
This is a bit misleading, e.g. the “legacy” interface doesn’t accept str
objects.
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode52
Doc/library/base64.rst:52: Optional *altchars* must be a
:term:`bytes-like object` of at least
Safer to say it must be a bytes object. The code does an assert using
len().
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode61
Doc/library/base64.rst:61: Decode the Base64 encoded :term:`bytes-like
object` *s* and return
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode64
Doc/library/base64.rst:64: Optional *altchars* must be a
:term:`bytes-like object` of
The code goes out of its way to also support ASCII character strings
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode85
Doc/library/base64.rst:85: Decode :term:`bytes-like object` *s* using
the standard Base64 alphabet
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode99
Doc/library/base64.rst:99: Decode :term:`bytes-like object` *s* using a
URL-safe alphabet, which
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode112
Doc/library/base64.rst:112: Decode the Base32 encoded :term:`bytes-like
object` *s* and return
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode139
Doc/library/base64.rst:139: Decode the Base16 encoded :term:`bytes-like
object` *s* and return the
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode175
Doc/library/base64.rst:175: Decode the Ascii85 encoded :term:`bytes-like
object` *s* and return
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode185
Doc/library/base64.rst:185: *ignorechars* should be a :term:`bytes-like
object` containing characters to ignore
Safer to just say bytes; the code tests “x in ignorechars”
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode205
Doc/library/base64.rst:205: Decode the base85-encoded :term:`bytes-like
object` *b* and return
or ASCII str
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode233
Doc/library/base64.rst:233: Decode the :term:`bytes-like object` *s*,
which must contain one or more lines of base64
The object must also be a one-dimensional array of bytes (c, b or B
format)
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode234
Doc/library/base64.rst:234: encoded data, and return the decoded
:class:`bytes` ``decodestring`` is a deprecated alias.
Dropped a full stop. Which is why I like starting sentences with capital
letters :)
http://bugs.python.org/review/1753718/diff/16149/Doc/library/base64.rst#newcode252
Doc/library/base64.rst:252: Encode the :term:`bytes-like object` *s*,
which can contain arbitrary binary
Same 1-D byte array restriction applies
http://bugs.python.org/review/1753718/
More information about the docs
mailing list