From b1ad2190a2ef5f9529176075d7b3318e6f39e35c Mon Sep 17 00:00:00 2001 From: David Pursehouse Date: Wed, 30 Sep 2015 10:35:43 +0900 Subject: [PATCH] Sync: Don't fail when git cookies can't be loaded If the git cookies file fails to load, use a default cookie jar instead. Bug: Issue 207 Change-Id: I7cb326c204f2784ab4dbd13801b3186667af5b78 --- subcmds/sync.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/subcmds/sync.py b/subcmds/sync.py index a99d7e74..dc6604cc 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -925,7 +925,10 @@ class PersistentTransport(xmlrpc.client.Transport): tmpcookiefile.flush() cookiejar = cookielib.MozillaCookieJar(tmpcookiefile.name) - cookiejar.load() + try: + cookiejar.load() + except cookielib.LoadError: + cookiejar = cookielib.CookieJar() finally: tmpcookiefile.close() else: