summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorCollin Fijalkovich <cfijalkovich@google.com>2020-02-18 10:57:32 -0800
committerMike Frysinger <vapier@google.com>2020-02-18 19:20:53 +0000
commite1191b3adb22e0b406db87691b13ddab2c236267 (patch)
treeaa925f4d4f81367d984adc579b11fb0f4a24fa78 /subcmds/sync.py
parent8f9bf484d816196ec19c859d97a23e9c4592188b (diff)
downloadgit-repo-e1191b3adb22e0b406db87691b13ddab2c236267.tar.gz
Open temporary cookie file as writable in sync.py
Named Temporary file defaults to mode 'w+b' which causes repo sync to fail. By opening the tmpcookiefile in PersistentTransport.request as writable, we are able to run sync successfully. Bug: https://crbug.com/gerrit/12370 Test: Ran smartsync successfully Change-Id: I01ddf915fc30eb3ff0e4d440a6f1aa261c63e88d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/255692 Tested-by: Jonathan Nieder <jrn@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com>
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index cb285290..849e878c 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -1202,7 +1202,7 @@ class PersistentTransport(xmlrpc.client.Transport):
1202 # Since we're only using them for HTTP, copy the file temporarily, 1202 # Since we're only using them for HTTP, copy the file temporarily,
1203 # stripping those prefixes away. 1203 # stripping those prefixes away.
1204 if cookiefile: 1204 if cookiefile:
1205 tmpcookiefile = tempfile.NamedTemporaryFile() 1205 tmpcookiefile = tempfile.NamedTemporaryFile(mode='w')
1206 tmpcookiefile.write("# HTTP Cookie File") 1206 tmpcookiefile.write("# HTTP Cookie File")
1207 try: 1207 try:
1208 with open(cookiefile) as f: 1208 with open(cookiefile) as f: