summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2024-01-08 11:20:36 (GMT)
committerGitHub <noreply@github.com>2024-01-08 11:20:36 (GMT)
commit7390dffce0624f38f78441cf2b618f3ab98d3ce3 (patch)
tree72fdd53967abbadc7a3fdfe82932259989e9e8c0
parentad2d5ec97e12063b7265faa8b0654bcf82a33545 (diff)
downloadcpython-7390dffce0624f38f78441cf2b618f3ab98d3ce3.zip
cpython-7390dffce0624f38f78441cf2b618f3ab98d3ce3.tar.gz
cpython-7390dffce0624f38f78441cf2b618f3ab98d3ce3.tar.bz2
[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 <zspytz@gmail.com> Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
-rw-r--r--Lib/test/test_base64.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/test/test_base64.py b/Lib/test/test_base64.py
index fa03fa1..f6171d3 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+<Vd', foldspaces=True, adobe=False), b' '*7)
eq(base64.a85decode(b'y+<U', foldspaces=True, adobe=False), b' '*6)
eq(base64.a85decode(b'y+9', foldspaces=True, adobe=False), b' '*5)
+ eq(base64.a85decode(b'aaaaay', foldspaces=True), b'\xc9\x80\x0b@ ')
self.check_other_types(base64.a85decode, b'GB\\6`E-ZP=Df.1GEb>',
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)) + \