mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-12 23:56:13 +01:00
- conf.py: workaround for urllib2: reset basic auth retry count if a 404 is encountered
normally we should also do this for all status codes != 401 but so far it seems to be sufficient to do it only for 404
This commit is contained in:
parent
b7328b6adf
commit
b8c3a23b90
11
osc/conf.py
11
osc/conf.py
@ -411,6 +411,17 @@ def _build_opener(url):
|
||||
self.retried = 0
|
||||
return response
|
||||
|
||||
def http_error_404(self, *args):
|
||||
self.retried = 0
|
||||
return None
|
||||
|
||||
authhandler_class = OscHTTPBasicAuthHandler
|
||||
elif sys.version_info >= (2, 6, 6) and sys.version_info < (2, 7, 1):
|
||||
class OscHTTPBasicAuthHandler(urllib2.HTTPBasicAuthHandler):
|
||||
def http_error_404(self, *args):
|
||||
self.reset_retry_count()
|
||||
return None
|
||||
|
||||
authhandler_class = OscHTTPBasicAuthHandler
|
||||
elif sys.version_info >= (2, 6, 5) and sys.version_info < (2, 6, 6):
|
||||
# workaround for broken urllib2 in python 2.6.5: wrong credentials
|
||||
|
Loading…
Reference in New Issue
Block a user