[Patches] [ python-Patches-1496206 ] urllib2 HTTPPasswordMgr: default ports

SourceForge.net noreply at sourceforge.net
Sun May 28 01:42:32 CEST 2006


Patches item #1496206, was opened at 2006-05-28 00:36
Message generated for change (Comment added) made by jjlee
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1496206&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Library (Lib)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: John J Lee (jjlee)
>Assigned to: Georg Brandl (gbrandl)
Summary: urllib2 HTTPPasswordMgr: default ports

Initial Comment:
urllib2 HTTPPasswordMgr had support for ports added
during 2.5 development, but that code doesn't know
about the default HTTP / HTTPS ports.  As a result, for
example, a fetch of "https://example.com:443"
301-redirected to "https://example.com/" (as a local
Apache server did on my linux box) will fail unless you
register both "example.com:443" and "example.com" with
the HTTPPasswordMgr.  I'd call that a bug.

The patch adds a new test and takes care not to break
the case where old code calls add_password for
example.com and then find_user_password is called for
example.com (with no explicit port).

The patch also comments out one test which was testing
something not actually guaranteed by the code at all --
it was passing by fluke.  The code it's trying to test
could do with some review, which is why I left this
test commented out rather than deleting the test (but
that is a long-standing issue unrelated to this patch,
so should not block this patch from being applied).


----------------------------------------------------------------------

>Comment By: John J Lee (jjlee)
Date: 2006-05-28 00:42

Message:
Logged In: YES 
user_id=261020

Assigning to Georg since he added the default port support.

(Actually, the support for ports added during 2.5
development was specifically for proxies IIRC: ordinary
(non-proxy) Basic Auth for URLs with a port did work prior
to 2.5, I think.  Still, this patch is backwards-compatible.)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1496206&group_id=5470


More information about the Patches mailing list