From 28c3bc626827a44b7b63c20f67dc4e56a2bdaab6 Mon Sep 17 00:00:00 2001 From: Lubomír Sedlář Date: Oct 31 2017 10:10:27 +0000 Subject: notification: Fix running on Python 3 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ář --- diff --git a/pungi/notifier.py b/pungi/notifier.py index 282a9ee..0fb2562 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 6647252..833b965 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')