diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-07 23:18:23 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-10 23:28:40 -0500 |
commit | 471a7ed5f77ac6b38fc9ef60d9fff2c9924a2df8 (patch) | |
tree | 56b50051328ebf3ce1cf77abf56a15dd50b08dbc | |
parent | 619a2b58871e03ecc4f40b93a183206b51853fa5 (diff) | |
download | git-repo-471a7ed5f77ac6b38fc9ef60d9fff2c9924a2df8.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>
(cherry picked from commit ded477dbb9c6993cbe8b93b10654682b04fdeea8)
-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: |