Message99940
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. |
|
Date |
User |
Action |
Args |
2010-02-23 17:42:29 | orsenthil | set | recipients:
+ orsenthil, nirai, jamal |
2010-02-23 17:42:28 | orsenthil | set | messageid: <1266946948.92.0.039014588275.issue6452@psf.upfronthosting.co.za> |
2010-02-23 17:42:27 | orsenthil | link | issue6452 messages |
2010-02-23 17:42:27 | orsenthil | create | |
|