This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients jamal, nirai, orsenthil
Date 2010-02-23.17:42:26
SpamBayes Score 0.00077843625
Marked as misclassified No
Message-id <1266946948.92.0.039014588275.issue6452@psf.upfronthosting.co.za>
In-reply-to
Content
There is a OLD Known issue that base64.encodestring will insert in a line-break in the authorization header. See Issue1574068
I fear, you might have done something like this.

base64string = base64.encodestring('%s:%s' %(username,passwd))[:-1]
request.add_header("Authorization","Basic %s" % base64string)
urllib2.urlopen(request)

You might have encountered this problem of Request not working with long authorization headers.
Instead, if you do

base64string = base64.b64encode('%s:%s' %(username,passwd))[:-1]

and then add the string to your headers, it might work properly. It does so for me.

(alternatively you can set base64.MAXBINSIZE=1000000, but the first solution is much cleaner.

I am closing this bug as Invalid. If you feel, it is valid and you used base64.b64encode for encoding the Basic Authentication header. feel free to reopen the bug, with a snippet of code attached.
History
Date User Action Args
2010-02-23 17:42:29orsenthilsetrecipients: + orsenthil, nirai, jamal
2010-02-23 17:42:28orsenthilsetmessageid: <1266946948.92.0.039014588275.issue6452@psf.upfronthosting.co.za>
2010-02-23 17:42:27orsenthillinkissue6452 messages
2010-02-23 17:42:27orsenthilcreate