[Python-bugs-list] [ python-Bugs-595671 ] base64.decodestring raises error on ""

noreply@sourceforge.net noreply@sourceforge.net
Thu, 15 Aug 2002 11:27:35 -0700


Bugs item #595671, was opened at 2002-08-15 18:27
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595671&group_id=5470

Category: Python Library
Group: Python 2.2.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Danny Yoo (dyoo)
Assigned to: Nobody/Anonymous (nobody)
Summary: base64.decodestring raises error on ""

Initial Comment:
The SOAPpy project uses base64.decodestring() to decode
base64-encoded strings.  One issue that's been brought
up is the exception-raising behavior of decodestring()
if given the empty string in Python 2.2:

### In Python 2.2.1
>>> base64.decodestring("")
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "/opt/Python-2.2/lib/python2.2/base64.py", line
44, in decodestring
    return binascii.a2b_base64(s)
binascii.Error: Cannot decode empty input
###

This is a behavioral change from Python 2.1.1, where it
had previously returned the empty string:

### Python 2.1.1
>>> base64.decodestring("")
""
###

This change seems to have been introduced in -r2.29 of
binascii.c.  Is this the expected behavior of
decodestring() now?

For more information about our discussion on this,
please see the thread started here:

http://www.geocrawler.com/lists/3/SourceForge/12392/0/9289852/

Thanks again!

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=595671&group_id=5470