[issue2299] accessing HTTP(S) repos on Python 2.6.5 may cause "authorization failed"

zenyatta bugs at mercurial.selenic.com
Thu Jul 22 13:17:05 UTC 2010


New submission from zenyatta <jh at journey.sk>:

When fixing http://bugs.python.org/issue8797 , Python developers introduced
a retry limit into AbstractBasicAuthHandler; the handler will raise an
exception after five "401" responses. When accessing a Mercurial repo via
HTTP or HTTPS with basic authentication, this causes an "authorization
failed" abort when the operation to be performed requires more than 5
requests to the server. The number of requests seems to be proportional to
the difference between the server's repository and the local one (not sure
if it's the number of changesets or number of branches affected, or even
something else). So if you do "hg pull" frequently and/or your upstream is
relatively static, you may never see an error. I'm on a busy team with many
branches so I had to deal with this.

I have submitted a patch to the Python bugtracker that resets the retry
counter after a successful authentication - see
http://bugs.python.org/issue8797. I'm afraid I have no time to implement a
work-around in Mercurial (a fresh handler for each request should do the
trick). I did perform some tests; the bug is present in release 1.6, as
well as in the current head of http://selenic.com/repo/hg
(1.6+105-6b7b99867ada) and the current head of http://selenic.com/repo/hg-
stable (1.5.4+154-8b452fe4bf50).

----------
messages: 13174
nosy: zenyatta
priority: bug
status: unread
title: accessing HTTP(S) repos on Python 2.6.5 may cause "authorization failed"

____________________________________________________
Mercurial issue tracker <bugs at mercurial.selenic.com>
<http://mercurial.selenic.com/bts/issue2299>
____________________________________________________


More information about the Mercurial-devel mailing list