From 2cc4adede1c248740b5cded15bf5b3ef02f97e20 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Fri, 21 Jul 2023 09:38:06 +0200 Subject: Fix errors when use_git_credential is enabled That feature was broken since the switch to Python 3 --- git-bz | 7 ++++--- 1 file 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') -- cgit