From 778fb8450cf68dedb2c2fbd2e8642a915784162b Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Wed, 10 Jun 2026 18:36:49 +0100 Subject: [PATCH 1/3] Update `base64` module docstring to reference RFC 4648 --- Lib/base64.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/base64.py b/Lib/base64.py index 4a0e9d446edb0b..01e49eb0915ef2 100644 --- a/Lib/base64.py +++ b/Lib/base64.py @@ -1,4 +1,4 @@ -"""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 From 0c5283e7977ceb31784b4a46232bef8ef69e50e4 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 13 Jun 2026 12:37:52 +0100 Subject: [PATCH 2/3] Also update two other references --- Lib/base64.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Lib/base64.py b/Lib/base64.py index 01e49eb0915ef2..4f3231b35ce6e0 100644 --- a/Lib/base64.py +++ b/Lib/base64.py @@ -219,7 +219,7 @@ def urlsafe_b64decode(s, *, padded=False): characters present in the input. ''' _B32_DECODE_MAP01_DOCSTRING = ''' -RFC 3548 allows for optional mapping of the digit 0 (zero) to the +RFC 4648 allows for 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 @@ -266,9 +266,8 @@ def b32hexdecode(s, casefold=False, *, padded=True, ignorechars=b'', extra_args='') -# RFC 3548, Base 16 Alphabet specifies uppercase, but hexlify() returns -# lowercase. The RFC also recommends against accepting input case -# insensitively. +# RFC 4648, Base 16 Alphabet specifies uppercase, but hexlify() returns +# lowercase. def b16encode(s, *, wrapcol=0): """Encode the bytes-like object s using Base16 and return a bytes object. From aa2e49829b1970ea637c84dcc6b8339f1bcdc337 Mon Sep 17 00:00:00 2001 From: Stan Ulbrych Date: Sat, 13 Jun 2026 12:56:06 +0100 Subject: [PATCH 3/3] Keep consideration --- Lib/base64.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/base64.py b/Lib/base64.py index 4f3231b35ce6e0..fa562f74a81034 100644 --- a/Lib/base64.py +++ b/Lib/base64.py @@ -267,7 +267,8 @@ def b32hexdecode(s, casefold=False, *, padded=True, ignorechars=b'', # RFC 4648, Base 16 Alphabet specifies uppercase, but hexlify() returns -# lowercase. +# lowercase. The RFC also recommends against accepting input case +# insensitively. def b16encode(s, *, wrapcol=0): """Encode the bytes-like object s using Base16 and return a bytes object.