diff options
author | Thomas Wouters <thomas@python.org> | 2003-03-17 11:24:29 +0000 |
---|---|---|
committer | Thomas Wouters <thomas@python.org> | 2003-03-17 11:24:29 +0000 |
commit | 003e451a96d3d6c8dd9266d2bb0f918d28c113d8 (patch) | |
tree | 4281a05c8d3e8ef1b76f697ce23387b8b04b4418 /Lib/test/test_binascii.py | |
parent | dabd019bf5d1c462c45278dff5d6a5689c1255ab (diff) | |
download | cpython-003e451a96d3d6c8dd9266d2bb0f918d28c113d8.tar.gz |
binascii_a2b_base64: Properly return an empty string if the input was all
invalid, rather than returning a string of random garbage of the
estimated result length. Closes SF patch #703471 by Hye-Shik Chang.
Will backport to 2.2-maint (consider it done.)
Diffstat (limited to 'Lib/test/test_binascii.py')
-rwxr-xr-x | Lib/test/test_binascii.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py index f1f8b33f59..2764c3c5e5 100755 --- a/Lib/test/test_binascii.py +++ b/Lib/test/test_binascii.py @@ -69,6 +69,10 @@ for line in map(addnoise, lines): res = res + b verify(res == testdata) +# Test base64 with just invalid characters, which should return +# empty strings. TBD: shouldn't it raise an exception instead ? +verify(binascii.a2b_base64(fillers) == '') + # Test uu print "uu test" MAX_UU = 45 |