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ář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2017-10-31 11:09:45 +01:00
parent e0308a74ff
commit 28c3bc6268
2 changed files with 2 additions and 1 deletions

View File

@ -86,6 +86,7 @@ class PungiNotifier(object):
workdir=workdir, workdir=workdir,
return_stdout=False, return_stdout=False,
show_cmd=True, show_cmd=True,
universal_newlines=True,
logfile=logfile) logfile=logfile)
if ret != 0: if ret != 0:
if self.compose: if self.compose:

View File

@ -51,7 +51,7 @@ class TestNotifier(unittest.TestCase):
stdin_data=json.dumps(data), stdin_data=json.dumps(data),
can_fail=True, return_stdout=False, can_fail=True, return_stdout=False,
workdir=self.compose.paths.compose.topdir.return_value, 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('pungi.util.translate_path')
@mock.patch('kobo.shortcuts.run') @mock.patch('kobo.shortcuts.run')