The Doctor What wrote:
> The problem is that base64.encodestring() adds newlines to wrap the
> encoded characters at the 76th column.
> 

The encodestring is following RFC 1521 which speficies:

    The output stream (encoded bytes) must be represented in lines of no
    more than 76 characters each.  All line breaks or other characters
    not found in Table 1 must be ignored by decoding software.

In retrospect, perhaps "{de|en}codestring" was a poor name choice. 
urllib2 should be calling b64encode directly.

I have submitted a patch to the tracker: [ 1574068 ] urllib2 - Fix line 
breaks in authorization headers.

-- 
Scott Dial
[EMAIL PROTECTED]
[EMAIL PROTECTED]
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to