Skip to content

Commit 7357335

Browse files
miss-islingtonZackerySpytzleecannon
authored
[3.11] gh-74678: Increase base64 test coverage (GH-21913) (GH-113810)
Ensure the character y is disallowed within an Ascii85 5-tuple. (cherry picked from commit 802d495) Co-authored-by: Zackery Spytz <[email protected]> Co-authored-by: Lee Cannon <[email protected]>
1 parent 4db8d3b commit 7357335

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Lib/test/test_base64.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,7 @@ def test_a85decode(self):
582582
eq(base64.a85decode(b'y+<Vd', foldspaces=True, adobe=False), b' '*7)
583583
eq(base64.a85decode(b'y+<U', foldspaces=True, adobe=False), b' '*6)
584584
eq(base64.a85decode(b'y+9', foldspaces=True, adobe=False), b' '*5)
585+
eq(base64.a85decode(b'aaaaay', foldspaces=True), b'\xc9\x80\x0b@ ')
585586

586587
self.check_other_types(base64.a85decode, b'GB\\6`E-ZP=Df.1GEb>',
587588
b"www.python.org")
@@ -685,6 +686,8 @@ def test_a85decode_errors(self):
685686
self.assertRaises(ValueError, base64.a85decode, b's8W', adobe=False)
686687
self.assertRaises(ValueError, base64.a85decode, b's8W-', adobe=False)
687688
self.assertRaises(ValueError, base64.a85decode, b's8W-"', adobe=False)
689+
self.assertRaises(ValueError, base64.a85decode, b'aaaay',
690+
foldspaces=True)
688691

689692
def test_b85decode_errors(self):
690693
illegal = list(range(33)) + \

0 commit comments

Comments
 (0)