diff options
-rwxr-xr-x | git-bz | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -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) |