[issue13642] urllib incorrectly quotes username and password in https basic auth
report at bugs.python.org
Tue Jan 10 08:01:48 CET 2012
Joonas Kuorilehto <joneskoo at derbian.fi> added the comment:
Michele, in your patch:
+ authorization = ("Authorization: Basic %s\r\n" %
This is wrong. See the original report by me and RFC 2617. The username and password MUST NOT be url encoded before base64. That is the original problem. The point is that this test should fail with urllib before the change and not fail with the fix.
Secondly, I think unquote will fail when given a None. For me, some other unit tests caught this when I had the unquote where the splituser is called. I didn't run your code but are other urllib tests ok for you?
I like your change of having the base64 explicitly there and not as a magic string is a good idea.
Senthil, could you provide the better alternative for the class field abuse, please?
Python tracker <report at bugs.python.org>
More information about the Python-bugs-list