Smartsync: Don't fail if there isn't a cookiefile

Change-Id: I434a259f43ca9808e88051ac8ba865c519a24702
This commit is contained in:
Dan Willemsen 2015-08-20 10:09:20 -07:00
parent ba7bc738c1
commit 3010e5ba64

View File

@ -905,6 +905,7 @@ class PersistentTransport(xmlrpc.client.Transport):
# Python doesn't understand cookies with the #HttpOnly_ prefix # Python doesn't understand cookies with the #HttpOnly_ prefix
# Since we're only using them for HTTP, copy the file temporarily, # Since we're only using them for HTTP, copy the file temporarily,
# stripping those prefixes away. # stripping those prefixes away.
if cookiefile:
tmpcookiefile = tempfile.NamedTemporaryFile() tmpcookiefile = tempfile.NamedTemporaryFile()
try: try:
with open(cookiefile) as f: with open(cookiefile) as f:
@ -918,6 +919,8 @@ class PersistentTransport(xmlrpc.client.Transport):
cookiejar.load() cookiejar.load()
finally: finally:
tmpcookiefile.close() tmpcookiefile.close()
else:
cookiejar = cookielib.CookieJar()
proxyhandler = urllib.request.ProxyHandler proxyhandler = urllib.request.ProxyHandler
if proxy: if proxy: