[PATCH] Keep authentication information after the first fail HTTP access (issue3567)

Mads Kiilerich mads at kiilerich.com
Sun Jan 19 18:52:24 CST 2014


On 01/02/2014 12:20 AM, Augie Fackler wrote:
> On Mon, Dec 30, 2013 at 03:27:09PM +0100, Stéphane Klein wrote:
>> -----BEGIN PGP SIGNED MESSAGE-----
>> Hash: SHA256
>>
>> # HG changeset patch
>> # User Stéphane Klein <contact at stephane-klein.info>
>> # Date 1388413356 -3600
>> #      Mon Dec 30 15:22:36 2013 +0100
>> # Node ID 9063db5432d6c6c75491e759861a373bc493822a
>> # Parent  4274eda143cb1025be1130ffdaaf62370a2a6961
>> Keep authentication information after the first fail HTTP access (issue3567)
>>
> Looks reasonable here. Can someone run the testsuite for this on 2.4
> and 2.7 and verify it works? I don't have ready access to anything
> with Python 2.4 anymore.

Tested ... and it failed.

First meta failure is that the patch didn't show any test coverage.

test-http.t and python 2.4 failed with this patch ... but it has been 
failing for years as mentioned on 
http://bz.selenic.com/show_bug.cgi?id=2739#c17 .

python 2.4.3 showed similar failures. They can be fixed by using 
req.get_full_url() instead of host, like in 
http://hg.python.org/cpython/rev/ac02f655b31e . I haven't investigated 
why it fixes a problem - and why Python apparently backed the change out 
again. But testing with test-http.t with extra test coverage of this 
change and on 2.4 2.4.3 2.4.6 2.5 2.5.6 2.6 2.6.1 2.6.2 2.6.9 2.7 2.7.6 
shows that it works.

I just sent a series that includes the updated version of this patch and 
the prerequisites.

With these changes the patch looks good to me. It fixes an annoying 
problem that has been around forever. It is a hack, but that is how we 
usually make urllib2 usable. It also takes a nice step in the direction 
of including a full urllib2 so we can fix issues without problems with 
patching of different stdlib versions. ;-)

/Mads


More information about the Mercurial-devel mailing list