Hi,

There's some changes in the urllib2 reduce_uri function of the HTTPPasswdMgr between Python 2.3, 2.4, and 2.5 which are giving inconsistent results for doing extended basic auth header processing with urlgrabber.

In the python2.4 implementation, when urllib2 is chomping up the domain component to register against the realm, it requires the scheme to be present. urlgrabber isn't doing this, just passing the host, which is then abandoned, and thus no credentials get found for the url when a 401 is thrown. The Python 2.5 urllib2 implementation does appear to be a little smarter.

I'd appreciate if this patch could be applied and another devel points release made ASAP as I don't really want to fork urlgrabber.

Cheers, Alan
--- grabber.py.orig	2007-09-08 09:50:33.000000000 +1000
+++ grabber.py	2007-09-08 09:51:04.000000000 +1000
@@ -691,7 +691,7 @@
             except ValueError, e:
                 raise URLGrabError(1, _('Bad URL: %s') % url)
             if DEBUG: DEBUG.info('adding HTTP auth: %s, %s', user, password)
-            auth_handler.add_password(None, host, user, password)
+            auth_handler.add_password(None, '%s://%s' % (scheme, host), user, password)
 
         return (scheme, host, path, parm, query, frag)
 
_______________________________________________
Yum-devel mailing list
[email protected]
https://lists.dulug.duke.edu/mailman/listinfo/yum-devel

Reply via email to