[Python-3000] base64 - bytes and strings (original) (raw)
Joe Gregorio joe at bitworking.org
Sun Jul 29 03:47:05 CEST 2007
- Previous message: [Python-3000] optimizing [x]range
- Next message: [Python-3000] base64 - bytes and strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Previous message: [Python-3000] optimizing [x]range
- Next message: [Python-3000] base64 - bytes and strings
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]