[ python-Bugs-974757 ] urllib2's HTTPPasswordMgr and uri's with port numbers

SourceForge.net noreply at sourceforge.net
Fri Nov 5 11:08:16 CET 2004


Bugs item #974757, was opened at 2004-06-17 14:09
Message generated for change (Comment added) made by fresh
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=974757&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Chris Withers (fresh)
Assigned to: Nobody/Anonymous (nobody)
Summary: urllib2's HTTPPasswordMgr and uri's with port numbers

Initial Comment:
Python 2.3.3

The title just about sums it up.
If you add a password with a uri containing a port
number using add_password, then it probably won't be
returned by find_user_password.

That's not right ;-)

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

>Comment By: Chris Withers (fresh)
Date: 2004-11-05 10:08

Message:
Logged In: YES 
user_id=24723

This patch fixes it for me:

--- urllib2.py.cvs      Fri Nov 05 10:02:26 2004
+++ urllib2.py.new      Fri Nov 05 10:05:48 2004
@@ -720,7 +720,7 @@
                     return self.retry_http_basic_auth(host,
req, realm)

     def retry_http_basic_auth(self, host, req, realm):
-        user,pw = self.passwd.find_user_password(realm, host)
+        user,pw = self.passwd.find_user_password(realm,
req.get_full_url())
         if pw is not None:
             raw = "%s:%s" % (user, pw)
             auth = 'Basic %s' %
base64.encodestring(raw).strip()

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

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


More information about the Python-bugs-list mailing list