8000 base64 documentation is out-dated; altchars has to have the exact length of 2. · Issue #90717 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

base64 documentation is out-dated; altchars has to have the exact length of 2. #90717

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ynn mannequin opened this issue Jan 28, 2022 · 1 comment · Fixed by #94187
Closed

base64 documentation is out-dated; altchars has to have the exact length of 2. #90717

ynn mannequin opened this issue Jan 28, 2022 · 1 comment · Fixed by #94187
Labels
3.10 only security fixes docs Documentation in the Doc dir

Comments

@ynn
Copy link
Mannequin
ynn mannequin commented Jan 28, 2022
BPO 46559

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2022-01-28.02:52:31.566>
labels = ['3.10', 'docs']
title = 'base64 documentation is out-dated; altchars has to have the exact length of 2.'
updated_at = <Date 2022-01-28.02:52:31.566>
user = 'https://bugs.python.org/ynn'

bugs.python.org fields:

activity = <Date 2022-01-28.02:52:31.566>
actor = 'ynn'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2022-01-28.02:52:31.566>
creator = 'ynn'
dependencies = []
files = []
hgrepos = []
issue_num = 46559
keywords = []
message_count = 1.0
messages = ['411967']
nosy_count = 2.0
nosy_names = ['docs@python', 'ynn']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue46559'
versions = ['Python 3.10']

Linked PRs

@ynn
Copy link
Mannequin Author
ynn mannequin commented Jan 28, 2022

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)

@ynn ynn mannequin added the 3.10 only security fixes label Jan 28, 2022
@ynn ynn mannequin assigned docspython Jan 28, 2022
@ynn ynn mannequin added docs Documentation in the Doc dir 3.10 only security fixes labels Jan 28, 2022
@ynn ynn mannequin assigned docspython Jan 28, 2022
@ynn ynn mannequin added the docs Documentation in the Doc dir label Jan 28, 2022
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Nov 29, 2022
…n base64 library (pythonGH-94187)

(cherry picked from commit 05dfc53)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
miss-islington added a commit that referenced this issue Nov 29, 2022
…64 library (GH-94187)

(cherry picked from commit 05dfc53)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
zooba added a commit that referenced this issue Nov 29, 2022
…64 library (GH-94187)

Co-authored-by: Sam Ezeh <sam.z.ezeh@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.10 only security fixes docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging a pull request may close this issue.

0 participants
0