aboutsummaryrefslogtreecommitdiffstats
path: root/src/vpp-api/python/vpp_papi/tests
diff options
context:
space:
mode:
authorPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-19 17:32:39 -0700
committerPaul Vinciguerra <pvinci@vinciconsulting.com>2019-03-19 17:36:32 -0700
commit3d04e3303a551ee15efad1c9e98aef1d5464a2fb (patch)
treee1b12592699986698c6c7e28bfe0a39bbd6f1ff7 /src/vpp-api/python/vpp_papi/tests
parent4dc5c7b905d9ccfa24f6fd7365a7d656c3efaa78 (diff)
vpp_papi: specify encoding for .encode()/.decode()
py2 defaults to 'ascii', py3 defaults to 'utf-8'. Change-Id: Ib76d0ec56f24535e4bafd397cc6fb5e85967d508 Signed-off-by: Paul Vinciguerra <pvinci@vinciconsulting.com>
Diffstat (limited to 'src/vpp-api/python/vpp_papi/tests')
-rwxr-xr-xsrc/vpp-api/python/vpp_papi/tests/test_vpp_serializer.py4
1 files changed, 2 insertions, 2 deletions
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)