summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-11 03:35:24 -0500
committerMike Frysinger <vapier@google.com>2020-02-11 18:49:47 +0000
commit163d42eb43ba79677aae22fa859896010badba9b (patch)
tree040e79d53ffe1d018d58ae42ea3f593c88646801 /project.py
parent07392ed32662006c029299bc06617310cfe17957 (diff)
downloadgit-repo-163d42eb43ba79677aae22fa859896010badba9b.tar.gz
project: fix bytes/str encoding when updating git submodules
Since tempfile.mkstemp() returns a file handle in binary mode, make sure we turn our strings into bytes before writing. Bug: https://crbug.com/gerrit/12043 Change-Id: I3e84d595e84b8bc12a1fbc7fd0bb3ea0ba2832b0 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254393 Reviewed-by: Michael Mortensen <mmortensen@google.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/project.py b/project.py
index a305d720..0e047f8a 100644
--- a/project.py
+++ b/project.py
@@ -2073,7 +2073,7 @@ class Project(object):
2073 gitmodules_lines = [] 2073 gitmodules_lines = []
2074 fd, temp_gitmodules_path = tempfile.mkstemp() 2074 fd, temp_gitmodules_path = tempfile.mkstemp()
2075 try: 2075 try:
2076 os.write(fd, p.stdout) 2076 os.write(fd, p.stdout.encode('utf-8'))
2077 os.close(fd) 2077 os.close(fd)
2078 cmd = ['config', '--file', temp_gitmodules_path, '--list'] 2078 cmd = ['config', '--file', temp_gitmodules_path, '--list']
2079 p = GitCommand(None, cmd, capture_stdout=True, capture_stderr=True, 2079 p = GitCommand(None, cmd, capture_stdout=True, capture_stderr=True,