From: Zac Medico Date: Tue, 22 Apr 2008 18:29:51 +0000 (-0000) Subject: Make dir_get_metadata() retry if a httplib.ResponseNotReady exception X-Git-Tag: v2.2_pre6~134 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c33c150ec8ef22b1dd60a083b891e04d0ada6813;p=portage.git Make dir_get_metadata() retry if a httplib.ResponseNotReady exception occurs. svn path=/main/trunk/; revision=9943 --- diff --git a/pym/portage/getbinpkg.py b/pym/portage/getbinpkg.py index 5ace5b0b6..75f3a352a 100644 --- a/pym/portage/getbinpkg.py +++ b/pym/portage/getbinpkg.py @@ -616,6 +616,14 @@ def dir_get_metadata(baseurl, conn=None, chunk_size=3000, verbose=1, usingcache= # connection before sending a valid response". conn, protocol, address, params, headers = create_conn( baseurl) + except httplib.ResponseNotReady: + # With some http servers this error is known to be thrown + # from conn.getresponse() in make_http_request() when the + # remote file does not have appropriate read permissions. + # Maybe it's possible to recover from this exception in + # cases though, so retry. + conn, protocol, address, params, headers = create_conn( + baseurl) if myid and myid[0]: metadata[baseurl]["data"][x] = make_metadata_dict(myid)