From 3d04e3303a551ee15efad1c9e98aef1d5464a2fb Mon Sep 17 00:00:00 2001 From: Paul Vinciguerra Date: Tue, 19 Mar 2019 17:32:39 -0700 Subject: vpp_papi: specify encoding for .encode()/.decode() py2 defaults to 'ascii', py3 defaults to 'utf-8'. Change-Id: Ib76d0ec56f24535e4bafd397cc6fb5e85967d508 Signed-off-by: Paul Vinciguerra --- src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py') diff --git a/src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py b/src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py index ca3afc4dcef..4fbda2a01af 100755 --- a/src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py +++ b/src/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py @@ -230,7 +230,7 @@ class TestAddType(unittest.TestCase): inet_pton(AF_INET, '2.2.2.2')) string = 'foobar foobar' - b = s.pack({'length': len(string), 'string': string.encode()}) + b = s.pack({'length': len(string), 'string': string.encode('utf-8')}) nt, size = s.unpack(b) self.assertEqual(len(b), size) @@ -239,7 +239,7 @@ class TestAddType(unittest.TestCase): ['u8', 'string', 0, 'length']]) string = '' - b = s.pack({'length': len(string), 'string': string.encode()}) + b = s.pack({'length': len(string), 'string': string.encode('utf-8')}) nt, size = s.unpack(b) self.assertEqual(len(b), size) -- cgit 1.2.3-korg