Index: osc/core.py =================================================================== --- osc/core.py (Revision 3704) +++ osc/core.py (Arbeitskopie) @@ -1385,11 +1385,12 @@ raise - fd = urllib2.urlopen(req, data=data) + try: + fd = urllib2.urlopen(req, data=data) + finally: + if hasattr(conf.cookiejar, 'save'): + conf.cookiejar.save(ignore_discard=True) - if hasattr(conf.cookiejar, 'save'): - conf.cookiejar.save(ignore_discard=True) - if filefd: filefd.close() # this code is for debugging empty responses from api.opensuse.org