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.)
This commit is contained in:
Thomas Wouters 2003-03-17 11:24:29 +00:00
parent 450bd873ac
commit 9e1c192525
2 changed files with 12 additions and 1 deletions

View file

@ -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