diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-07 23:18:23 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-08 06:26:36 +0000 |
commit | ded477dbb9c6993cbe8b93b10654682b04fdeea8 (patch) | |
tree | 6619ab200e1376133174e7c6e4b2c5972778916a | |
parent | 93293ca47f3a898b30eecf21e7b4e1038780c867 (diff) | |
download | git-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>
-rw-r--r-- | git_config.py | 4 |
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: |