summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2015-10-02 11:10:10 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2015-10-02 11:12:05 +0900
commit4c5f74e4521679d1dcc31c575d417387b9c51c87 (patch)
treee19f84c3ff67c767d0aaf488d51376d2cb357996
parentb1ad2190a2ef5f9529176075d7b3318e6f39e35c (diff)
downloadgit-repo-4c5f74e4521679d1dcc31c575d417387b9c51c87.tar.gz
Sync: Add HTTP Cookie File header on temporary cookie file
The .gitcookies file generated by googlesource.com does not have the header: # (Netscape) HTTP Cookie File which causes python's MozillaCookieJar.load to fail with the error: "does not look like a Netscape format cookies file" Prepend the expected header onto the generated cookie file. We don't bother to check if the header already exists on the file; repeating it does not cause any problem. Bug: Issue 207 Change-Id: I7d39720a1d36a6aae00f70691156514ebc04e579
-rw-r--r--subcmds/sync.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index dc6604cc..2a77065c 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -916,6 +916,7 @@ class PersistentTransport(xmlrpc.client.Transport):
916 # stripping those prefixes away. 916 # stripping those prefixes away.
917 if cookiefile: 917 if cookiefile:
918 tmpcookiefile = tempfile.NamedTemporaryFile() 918 tmpcookiefile = tempfile.NamedTemporaryFile()
919 tmpcookiefile.write("# HTTP Cookie File")
919 try: 920 try:
920 with open(cookiefile) as f: 921 with open(cookiefile) as f:
921 for line in f: 922 for line in f: