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).
|