https://github.com/python/cpython/commit/cbfebb1bc5d6a658dbb2784e5a3a5f3fcd4bea30
commit: cbfebb1bc5d6a658dbb2784e5a3a5f3fcd4bea30
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: serhiy-storchaka <[email protected]>
date: 2026-01-23T19:19:22Z
summary:

[3.13] gh-144027: Fix documentation for ignorechars in base64.a85decode() 
(GH-144028) (GH-144193)

It does not support an ASCII string.

Also add more tests.
(cherry picked from commit 25a10b60b04ab2fa802409dc6f211cf2ca028a0a)

Co-authored-by: Serhiy Storchaka <[email protected]>

files:
M Doc/library/base64.rst
M Lib/test/test_base64.py

diff --git a/Doc/library/base64.rst b/Doc/library/base64.rst
index 529a7242443820..1c2c57448ceeca 100644
--- a/Doc/library/base64.rst
+++ b/Doc/library/base64.rst
@@ -239,8 +239,7 @@ Refer to the documentation of the individual functions for 
more information.
    *adobe* controls whether the input sequence is in Adobe Ascii85 format
    (i.e. is framed with <~ and ~>).
 
-   *ignorechars* should be a :term:`bytes-like object` or ASCII string
-   containing characters to ignore
+   *ignorechars* should be a byte string containing characters to ignore
    from the input. This should only contain whitespace characters, and by
    default contains all whitespace characters in ASCII.
 
diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py
index 1d5bb6695d2bd2..368d359264ef6f 100644
--- a/Lib/test/test_base64.py
+++ b/Lib/test/test_base64.py
@@ -777,6 +777,19 @@ def test_a85decode_errors(self):
         self.assertRaises(ValueError, base64.a85decode, b'aaaay',
                           foldspaces=True)
 
+        self.assertEqual(base64.a85decode(b"a b\nc", ignorechars=b" \n"),
+                         b'\xc9\x89')
+        with self.assertRaises(ValueError):
+            base64.a85decode(b"a b\nc", ignorechars=b"")
+        with self.assertRaises(ValueError):
+            base64.a85decode(b"a b\nc", ignorechars=b" ")
+        with self.assertRaises(ValueError):
+            base64.a85decode(b"a b\nc", ignorechars=b"\n")
+        with self.assertRaises(TypeError):
+            base64.a85decode(b"a b\nc", ignorechars=" \n")
+        with self.assertRaises(TypeError):
+            base64.a85decode(b"a b\nc", ignorechars=None)
+
     def test_b85decode_errors(self):
         illegal = list(range(33)) + \
                   list(b'"\',./:[\\]') + \

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to