[Python-3000] base64 - bytes and strings

Joe Gregorio joe at bitworking.org
Sun Jul 29 03:47:05 CEST 2007


I just submitted a patch to fix test_urllib2 and test_cookielib. In the
process of fixing them I came across something that looks like an
inconsistency in the base64 module.

Right now the base64 module uses bytes for everything. That is,
a value passed to b64encode() must be bytes, and the
base64 encoded response is also in bytes.

Shouldn't it operate more like expat, with the stuff to be
encoded is bytes and the encoded form is a string?
It seems more natural if the encoded value is a string since
base64 encoding is a way of encoding data
so that it fits in US-ASCII.

   Thanks,
   -joe

-- 
Joe Gregorio        http://bitworking.org


More information about the Python-3000 mailing list