From c33c150ec8ef22b1dd60a083b891e04d0ada6813 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 22 Apr 2008 18:29:51 +0000 Subject: [PATCH] Make dir_get_metadata() retry if a httplib.ResponseNotReady exception occurs. svn path=/main/trunk/; revision=9943 --- pym/portage/getbinpkg.py | 8 ++++++++ 1 file changed, 8 insertions(+) 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) -- 2.26.2