summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorThomas Wouters <thomas@python.org>2003-03-17 11:24:29 (GMT)
committerThomas Wouters <thomas@python.org>2003-03-17 11:24:29 (GMT)
commit9e1c192525f0382ec1e8710c2f8e1dcef389ff77 (patch)
tree9587e0b075fa6b6589e5d4734005a6a9b4a8ac30 /Lib/test
parent450bd873ac9a7d44d24498b67cd111ce77334e85 (diff)
downloadcpython-9e1c192525f0382ec1e8710c2f8e1dcef389ff77.zip
cpython-9e1c192525f0382ec1e8710c2f8e1dcef389ff77.tar.gz
cpython-9e1c192525f0382ec1e8710c2f8e1dcef389ff77.tar.bz2
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')
-rwxr-xr-xLib/test/test_binascii.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_binascii.py b/Lib/test/test_binascii.py
index f1f8b33..2764c3c 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