summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorMike Frysinger <vapier@google.com>2020-02-07 23:18:23 -0500
committerMike Frysinger <vapier@google.com>2020-02-08 06:26:36 +0000
commitded477dbb9c6993cbe8b93b10654682b04fdeea8 (patch)
tree6619ab200e1376133174e7c6e4b2c5972778916a /git_config.py
parent93293ca47f3a898b30eecf21e7b4e1038780c867 (diff)
downloadgit-repo-ded477dbb9c6993cbe8b93b10654682b04fdeea8.tar.gz
git_config: fix encoding handling in GetUrlCookieFile
Make sure we decode the bytes coming from the subprocess.Popen as we're treating them as strings. Change-Id: I44100ca5cd94f68a35d489936292eb641006edbe Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/253973 Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py
index 680de90f..8de3200c 100644
--- a/git_config.py
+++ b/git_config.py
@@ -528,7 +528,7 @@ def GetUrlCookieFile(url, quiet):
528 cookiefile = None 528 cookiefile = None
529 proxy = None 529 proxy = None
530 for line in p.stdout: 530 for line in p.stdout:
531 line = line.strip() 531 line = line.strip().decode('utf-8')
532 if line.startswith(cookieprefix): 532 if line.startswith(cookieprefix):
533 cookiefile = os.path.expanduser(line[len(cookieprefix):]) 533 cookiefile = os.path.expanduser(line[len(cookieprefix):])
534 if line.startswith(proxyprefix): 534 if line.startswith(proxyprefix):
@@ -540,7 +540,7 @@ def GetUrlCookieFile(url, quiet):
540 finally: 540 finally:
541 p.stdin.close() 541 p.stdin.close()
542 if p.wait(): 542 if p.wait():
543 err_msg = p.stderr.read() 543 err_msg = p.stderr.read().decode('utf-8')
544 if ' -print_config' in err_msg: 544 if ' -print_config' in err_msg:
545 pass # Persistent proxy doesn't support -print_config. 545 pass # Persistent proxy doesn't support -print_config.
546 elif not quiet: 546 elif not quiet: