Author bkline
Recipients
Date 2007-04-18.16:56:39
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
In the documentation for urllib2, the example [1] for using basic HTTP authentication has the following code for the call to add_password():

auth_handler.add_password('realm', 'host', 'username', 'password')

This actually worked in earlier (pre-2.4.3) versions of urllib2, but even in those older versions, the documentation for HTTPPasswordMgr.add_password() makes it clear that a URI must be passed as the second argument to the method, not a host name.

Even though the behavior in the library method has changed (passing a full URI versions of Python earlier than 2.4.3 didn't work, at least when a non-standard port was specified), the documentation has not changed (the add_password() documentation specifies a URI, even in the pre-2.4.3 versions of Python) and the examples in the documentation for urllib2 still say 'host'.

[1] http://docs.python.org/lib/urllib2-examples.html
History
Date User Action Args
2007-08-23 14:53:12adminlinkissue1703110 messages
2007-08-23 14:53:12admincreate