Message31826
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 |
|
| Date |
User |
Action |
Args |
| 2007-08-23 14:53:12 | admin | link | issue1703110 messages |
| 2007-08-23 14:53:12 | admin | create | |
|