Skip to content

Commit 802d495

Browse files
gh-74678: Increase base64 test coverage (GH-21913)
Ensure the character y is disallowed within an Ascii85 5-tuple. Co-authored-by: Lee Cannon <[email protected]>
1 parent 73c9326 commit 802d495

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
@@ -586,6 +586,7 @@ def test_a85decode(self):
586586
eq(base64.a85decode(b'y+<Vd', foldspaces=True, adobe=False), b' '*7)
587587
eq(base64.a85decode(b'y+<U', foldspaces=True, adobe=False), b' '*6)
588588
eq(base64.a85decode(b'y+9', foldspaces=True, adobe=False), b' '*5)
589+
eq(base64.a85decode(b'aaaaay', foldspaces=True), b'\xc9\x80\x0b@ ')
589590

590591
self.check_other_types(base64.a85decode, b'GB\\6`E-ZP=Df.1GEb>',
591592
b"www.python.org")
@@ -689,6 +690,8 @@ def test_a85decode_errors(self):
689690
self.assertRaises(ValueError, base64.a85decode, b's8W', adobe=False)
690691
self.assertRaises(ValueError, base64.a85decode, b's8W-', adobe=False)
691692
self.assertRaises(ValueError, base64.a85decode, b's8W-"', adobe=False)
693+
self.assertRaises(ValueError, base64.a85decode, b'aaaay',
694+
foldspaces=True)
692695

693696
def test_b85decode_errors(self):
694697
illegal = list(range(33)) + \

0 commit comments

Comments
 (0)