diff --git a/britney2/policies/sruadtregression.py b/britney2/policies/sruadtregression.py index fe202e8..17b56fb 100644 --- a/britney2/policies/sruadtregression.py +++ b/britney2/policies/sruadtregression.py @@ -58,6 +58,7 @@ class SRUADTRegressionPolicy(BasePolicy, Rest): raise last_exception bugs = set() for l in changes: + l = l.decode('utf-8') if l.startswith('Launchpad-Bugs-Fixed: '): bugs = {int(b) for b in l.split()[1:]} break diff --git a/tests/test_sruadtregression.py b/tests/test_sruadtregression.py index a85e3c7..218e713 100755 --- a/tests/test_sruadtregression.py +++ b/tests/test_sruadtregression.py @@ -22,7 +22,7 @@ from britney2.policies.sruadtregression import SRUADTRegressionPolicy from tests.test_sourceppa import FakeBritney -FAKE_CHANGES = """Format: 1.8 +FAKE_CHANGES = b"""Format: 1.8 Date: Mon, 16 Jul 2018 17:05:18 -0500 Source: test Binary: test @@ -96,7 +96,7 @@ class T(unittest.TestCase): def setUp(self): super().setUp() - @patch('britney2.policies.sruadtregression.urlopen', return_value=iter(FAKE_CHANGES.split('\n'))) + @patch('britney2.policies.sruadtregression.urlopen', return_value=iter(FAKE_CHANGES.split(b'\n'))) def test_bugs_from_changes(self, urlopen_mock): """Check extraction of bug numbers from .changes files""" with TemporaryDirectory() as tmpdir: