From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Mon, 8 Jan 2024 11:20:36 +0000 (+0100) Subject: [3.12] gh-74678: Increase base64 test coverage (GH-21913) (GH-113811) X-Git-Tag: v3.12.2~212 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7390dffce0624f38f78441cf2b618f3ab98d3ce3;p=thirdparty%2FPython%2Fcpython.git [3.12] gh-74678: Increase base64 test coverage (GH-21913) (GH-113811) Ensure the character y is disallowed within an Ascii85 5-tuple. (cherry picked from commit 802d4954f12541ba28dd7f18bf4a65054941a80d) Co-authored-by: Zackery Spytz Co-authored-by: Lee Cannon --- diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py index fa03fa1d61ce..f6171d3ed4ef 100644 --- a/Lib/test/test_base64.py +++ b/Lib/test/test_base64.py @@ -586,6 +586,7 @@ class BaseXYTestCase(unittest.TestCase): eq(base64.a85decode(b'y+', b"www.python.org") @@ -689,6 +690,8 @@ class BaseXYTestCase(unittest.TestCase): self.assertRaises(ValueError, base64.a85decode, b's8W', adobe=False) self.assertRaises(ValueError, base64.a85decode, b's8W-', adobe=False) self.assertRaises(ValueError, base64.a85decode, b's8W-"', adobe=False) + self.assertRaises(ValueError, base64.a85decode, b'aaaay', + foldspaces=True) def test_b85decode_errors(self): illegal = list(range(33)) + \