From 28c3bc626827a44b7b63c20f67dc4e56a2bdaab6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Tue, 31 Oct 2017 11:09:45 +0100 Subject: [PATCH] notification: Fix running on Python 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The input is given as unicode value, not a bytestring. We need universal newlines to handle the conversion as needed. Signed-off-by: Lubomír Sedlář --- pungi/notifier.py | 1 + tests/test_notifier.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pungi/notifier.py b/pungi/notifier.py index 282a9ee0..0fb2562a 100644 --- a/pungi/notifier.py +++ b/pungi/notifier.py @@ -86,6 +86,7 @@ class PungiNotifier(object): workdir=workdir, return_stdout=False, show_cmd=True, + universal_newlines=True, logfile=logfile) if ret != 0: if self.compose: diff --git a/tests/test_notifier.py b/tests/test_notifier.py index 66472529..833b965a 100644 --- a/tests/test_notifier.py +++ b/tests/test_notifier.py @@ -51,7 +51,7 @@ class TestNotifier(unittest.TestCase): stdin_data=json.dumps(data), can_fail=True, return_stdout=False, workdir=self.compose.paths.compose.topdir.return_value, - show_cmd=True, logfile=self.logfile) + universal_newlines=True, show_cmd=True, logfile=self.logfile) @mock.patch('pungi.util.translate_path') @mock.patch('kobo.shortcuts.run')