summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSlava Shishkin <slavashishkin@gmail.com>2022-04-16 00:23:00 +0300
committerSlava Shishkin <slavashishkin@gmail.com>2022-04-16 00:23:00 +0300
commitc02f4914b458d9feaeb87d1c78169eae0f543e74 (patch)
treead4979df9868eee67c7c5e937f3b003799675e3c
parentf8c5d13e47ceb978d1230708a8c8c8c668e8b332 (diff)
downloadgit-bz-c02f4914b458d9feaeb87d1c78169eae0f543e74.tar.gz
Partial conversion bytes to strings
-rwxr-xr-xgit-bz14
1 files changed, 7 insertions, 7 deletions
diff --git a/git-bz b/git-bz
index 1ca846e..16830b3 100755
--- a/git-bz
+++ b/git-bz
@@ -170,8 +170,8 @@ def git_run(command, *args, **kwargs):
if not quiet and not interactive:
# Using print here could result in Python adding a stray space
# before the next print
- sys.stderr.write(error)
- sys.stdout.write(output)
+ sys.stderr.write(error.decode())
+ sys.stdout.write(output.decode())
raise CalledProcessError(process.returncode, " ".join(to_run))
if interactive:
@@ -208,7 +208,7 @@ class GitCommit:
def rev_list_commits(*args, **kwargs):
kwargs_copy = dict(kwargs)
kwargs_copy['pretty'] = 'format:%s'
- output = git.rev_list(*args, **kwargs_copy)
+ output = git.rev_list(*args, **kwargs_copy).decode()
if output == "":
lines = []
else:
@@ -1013,7 +1013,7 @@ class BugServer(object):
connection = get_connection(self.host, self.https)
connection.request("GET", self.path + "/index.cgi", '', headers)
res = connection.getresponse()
- match = re.search(r'name="Bugzilla_login_token"[\s]+value="([^"]*)', res.read())
+ match = re.search(r'name="Bugzilla_login_token"[\s]+value="([^"]*)', res.read().decode())
login_token = match.group(1)
headers = dict({})
headers['Cookie'] = login_request_cookie
@@ -1907,7 +1907,7 @@ def do_apply(*args):
die("No patches to apply, aborting")
for patch in patches:
- if re.search(r'(^|\n)From ', patch.data) is None:
+ if re.search(r'(^|\n)From ', patch.data.decode()) is None:
# Plain diff... rewrite it into something git-am will accept
users = bug.server.get_xmlrpc_proxy().User.get({'names': [patch.attacher]})['users']
name = users[0]['real_name']
@@ -1930,7 +1930,7 @@ FIXME: need commit message.
need_amend = False
handle, filename = tempfile.mkstemp(".patch", make_filename(patch.description) + "-")
- f = os.fdopen(handle, "w")
+ f = os.fdopen(handle, "wb")
f.write(patch.data)
f.close()
@@ -1967,7 +1967,7 @@ FIXME: need commit message.
# git-mailinfo to parse each patch, calling
# add_url_to_subject_body(), and then reassembling. That would
# be much more complicated though.
- commits = rev_list_commits(orig_head + "..")
+ commits = rev_list_commits(orig_head.decode() + "..")
add_url(bug, commits)
bugs_applied.append(bug_ref)