diff options
author | Julian Maurice <julian.maurice@biblibre.com> | 2023-07-21 09:38:06 +0200 |
---|---|---|
committer | Julian Maurice <julian.maurice@biblibre.com> | 2023-07-21 09:38:06 +0200 |
commit | 2cc4adede1c248740b5cded15bf5b3ef02f97e20 (patch) | |
tree | 221080abfba0c5d363f7ad3f6d1496f0c814cee9 | |
parent | 5f97df1070cf0c2f65ad9a91ea30b699b347f455 (diff) | |
download | git-bz-2cc4adede1c248740b5cded15bf5b3ef02f97e20.tar.gz |
Fix errors when use_git_credential is enabled
That feature was broken since the switch to Python 3
-rwxr-xr-x | git-bz | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -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') |