summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJulian Maurice <julian.maurice@biblibre.com>2023-07-21 09:38:06 +0200
committerJulian Maurice <julian.maurice@biblibre.com>2023-07-21 09:38:06 +0200
commit2cc4adede1c248740b5cded15bf5b3ef02f97e20 (patch)
tree221080abfba0c5d363f7ad3f6d1496f0c814cee9
parent5f97df1070cf0c2f65ad9a91ea30b699b347f455 (diff)
downloadgit-bz-2cc4adede1c248740b5cded15bf5b3ef02f97e20.tar.gz
Fix errors when use_git_credential is enabled
That feature was broken since the switch to Python 3
-rwxr-xr-xgit-bz7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-bz b/git-bz
index 62c5461..ebe2fe1 100755
--- a/git-bz
+++ b/git-bz
@@ -1029,6 +1029,7 @@ class BugServer(object):
"host={host}\npath={path}\n" \
"\n".format(protocol=protocol, host=self.host, path=self.path.lstrip('/'))
process = Popen(["git", "credential", "fill"],
+ text=True,
stdout=PIPE,
stdin=PIPE)
git_credential_output, error = process.communicate(git_credential_input)
@@ -1050,12 +1051,12 @@ class BugServer(object):
if self.use_git_credential:
# If page body doesn't contain 'Invalid Login' we consider it a
# successful login
- match = re.search('Invalid Login', res.read())
+ match = re.search('Invalid Login', res.read().decode('utf-8'))
if match:
- process = Popen(["git", "credential", "reject"], stdin=PIPE)
+ process = Popen(["git", "credential", "reject"], stdin=PIPE, text=True)
process.communicate(git_credential_output)
else:
- process = Popen(["git", "credential", "approve"], stdin=PIPE)
+ process = Popen(["git", "credential", "approve"], stdin=PIPE, text=True)
process.communicate(git_credential_output)
self.cookiestring = res.getheader('set-cookie')