-
-
Notifications
You must be signed in to change notification settings - Fork 32.4k
bpo-36700: Updated obsolete references for RFC 3548 to RFC 4648 #2336
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
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10000 There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
#! /usr/bin/env python3 | ||
|
||
"""Base16, Base32, Base64 (RFC 3548), Base85 and Ascii85 data encodings""" | ||
"""Base16, Base32, Base64 (RFC 4648), Base85 and Ascii85 data encodings""" | ||
|
||
# Modified 04-Oct-1995 by Jack Jansen to use binascii module | ||
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 3548 support | ||
# Modified 30-Dec-2003 by Barry Warsaw to add full RFC 4648 support | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ...that appears to be an incorrect change, rewriting history... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call. I have reverted that in d585264. |
||
# Modified 22-May-2007 by Guido van Rossum to use bytes everywhere | ||
|
||
import re | ||
|
@@ -183,13 +183,14 @@ def b32decode(s, casefold=False, map01=None): | |
Optional casefold is a flag specifying whether a lowercase alphabet is | ||
acceptable as input. For security purposes, the default is False. | ||
|
||
RFC 3548 allows for optional mapping of the digit 0 (zero) to the | ||
One might desire an optional mapping of the digit 0 (zero) to the | ||
letter O (oh), and for optional mapping of the digit 1 (one) to | ||
either the letter I (eye) or letter L (el). The optional argument | ||
map01 when not None, specifies which letter the digit 1 should be | ||
mapped to (when map01 is not None, the digit 0 is always mapped to | ||
the letter O). For security purposes the default is None, so that | ||
0 and 1 are not allowed in the input. | ||
0 and 1 are not allowed in the input. Note that RFC 4648 (which | ||
made RFC 3548 obsolete) did not allow such a mapping. | ||
|
||
The result is returned as a bytes object. A binascii.Error is raised if | ||
the input is incorrectly padded or if there are non-alphabet | ||
|
@@ -248,7 +249,7 @@ def b32decode(s, casefold=False, map01=None): | |
|
||
|
||
|
||
# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns | ||
# RFC 4648, Base 16 Alphabet specifies uppercase, but hexlify() returns | ||
# lowercase. The RFC also recommends against accepting input case | ||
# insensitively. | ||
def b16encode(s): | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this true? Looks to me like the relevant language is present on page 5 of RFC 4648. The wording is a little different from RFC 3548 but the gist seems to be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change is also not mentioned in the Changes since RFC 3548 section. I think we can leave the original wording on these pages and just update the number.