mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-26 04:02:11 +01:00
save cookies even in case of urllib2.HTTPError exceptions [bnc#378421]
This commit is contained in:
parent
a4f4488a50
commit
40642ecaf4
@ -1385,12 +1385,15 @@ def http_request(method, url, headers={}, data=None, file=None):
|
||||
else:
|
||||
raise
|
||||
|
||||
# this handling is currently considered as temporary workaround, bug #378421
|
||||
try:
|
||||
fd = urllib2.urlopen(req, data=data)
|
||||
finally:
|
||||
|
||||
except urllib2.HTTPError:
|
||||
# make sure that cookies are saved nevertheless
|
||||
if hasattr(conf.cookiejar, 'save'):
|
||||
conf.cookiejar.save(ignore_discard=True)
|
||||
# handle the exception elsewhere
|
||||
raise
|
||||
|
||||
if filefd: filefd.close()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user