This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ynn
Recipients docs@python, ynn
Date 2022-01-28.02:52:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1643338351.59.0.133820925399.issue46559@roundup.psfhosted.org>
In-reply-to
Content
According to the documentation of base64 (https://docs.python.org/3/library/base64.html),

> Optional altchars must be a bytes-like object of at least length 2 (additional characters are ignored) which specifies an alternative alphabet for the + and / characters.

but this explanation is out-dated.

Actually this had been correct until the commit `4581ae5fa2450db3f00384e4b2e86654605100d4` was made for cpython in "2007".
(Thus, the explanation has been incorrect for about 15 years.)

The current implementation requires the length of `altchars` to be exactly two, as explicitly written in the comment:

> Optional altchars should be a byte string of length 2 which specifies an alternative alphabet for the '+' and '/' characters.

and the corresponding assertion is:

> assert len(altchars) == 2, repr(altchars)
History
Date User Action Args
2022-01-28 02:52:31ynnsetrecipients: + ynn, docs@python
2022-01-28 02:52:31ynnsetmessageid: <1643338351.59.0.133820925399.issue46559@roundup.psfhosted.org>
2022-01-28 02:52:31ynnlinkissue46559 messages
2022-01-28 02:52:31ynncreate