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.

classification
Title: urllib2 HTTPPasswordMgr: default ports
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, jjlee
Priority: normal Keywords: patch

Created on 2006-05-27 23:36 by jjlee, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
default_port.patch jjlee, 2006-05-27 23:36
Messages (3)
msg50369 - (view) Author: John J Lee (jjlee) Date: 2006-05-27 23:36
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).
msg50370 - (view) Author: John J Lee (jjlee) Date: 2006-05-27 23:42
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.)
msg50371 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2006-05-28 20:23
Logged In: YES 
user_id=849994

Thanks! Committed in rev. 46509.
History
Date User Action Args
2022-04-11 14:56:17adminsetgithub: 43423
2006-05-27 23:36:04jjleecreate