From e02fcc0bd909d2106d0cdf3b1d075857adeb87eb Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 06 2020 10:47:47 +0000 Subject: [PATCH 1/2] Encode the data passed onto the mail hook so it is of bytes type Fixes https://pagure.io/pagure/issue/4999 Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/hooks/mail.py b/pagure/hooks/mail.py index 989990b..bbb899e 100644 --- a/pagure/hooks/mail.py +++ b/pagure/hooks/mail.py @@ -128,7 +128,7 @@ class MailRunner(BaseRunner): proc = subprocess.Popen( [hook_file], cwd=repodir, stdin=subprocess.PIPE ) - proc.communicate(stdin) + proc.communicate(stdin.encode()) ecode = proc.wait() if ecode != 0: print("git_multimail failed") From f54a80831edaa413f3ce244b8d21e7ee051d18c2 Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Oct 06 2020 10:47:50 +0000 Subject: [PATCH 2/2] Fix flake8 issue Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/api/issue.py b/pagure/api/issue.py index 898c12e..6025117 100644 --- a/pagure/api/issue.py +++ b/pagure/api/issue.py @@ -1593,7 +1593,7 @@ def api_view_issues_history_detailed_stats( weeks_range = flask.request.args.get("weeks_range") or 53 try: weeks_range = int(weeks_range) - except: + except Exception: weeks_range = 53 repo = _get_repo(repo, username, namespace)