[Python-3000] base64.{decode,encode}string

Bill Janssen janssen at parc.com
Sat Oct 27 02:24:47 CEST 2007


> 2007/10/26, Bill Janssen <janssen at parc.com>:
> > I think encodestring() should return a string, not bytes, and
> > decodestring() should take either a string, or bytes containing an
> > ASCII-encoded string.  Otherwise, every place they'll ever be
> > used has to wrap an additional unicode/encode step around their
> > use.
> 
> I'm okay with being flexible on input. I think there ought to be
> separate functions returning bytes and str.

I'm fine with that, too.  I just think that the purpose of
standard_b64encode() is to take bytes and produce text, and the
purpose of standard_b64decode() is to take text and produce bytes.
But if we want to add encodestring_to_ascii(), to take bytes and
produce ASCII base64-encoded bytes, and decodestring_from_ascii(), to
take an ASCII-encoded string as bytes, and produce bytes, that's OK
with me.  But it seems odd.

Bill




More information about the Python-3000 mailing list