On Sun, 28 May 2006, Armin Rigo wrote: [...] > Now I'm stumbling upon this test for urllib2: > > >>> mgr = urllib2.HTTPPasswordMgr() > >>> add = mgr.add_password > >>> add("Some Realm", "http://example.com/", "joe", "password") > >>> add("Some Realm", "http://example.com/ni", "ni", "ni") > (...) > > Currently, we use the highest-level path where more than one > match: > > >>> mgr.find_user_password("Some Realm", "http://example.com/ni") > ('joe', 'password') > > Returning the outermost path is a bit strange, if you ask me, but I am > no expert here. Stranger is the fact that the actual implement actually > returns, not the outermost path at all -- there is no code to do that -- > but a random pick, the first match in dictionary order. The comment in > the test is just misleading. I believe that urllib2 should be fixed to > always return the *innermost* path, but I need confirmation about > this...
I noticed the same things, and in fact I think this was fixed before you posted :-) FWIW, here are the details: The checkin was from Georg as -r 46509, patch was http://python.org/sf/1496206 Part of the comment on the patch: """ 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). """ Recently I have been slowly working my way through urllib2 auth, fixing bugs and adding tests as I go. This particular issue is horribly unclear in the RFC, though, and I haven't yet got round to the necessary checking of real-world behaviour. John _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com