python3: Open packet data with binary mode

Signed-off-by: IWAMOTO Toshihiro <iwamoto@valinux.co.jp>
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
This commit is contained in:
IWAMOTO Toshihiro 2015-06-24 18:47:06 +09:00 committed by FUJITA Tomonori
parent a23734444c
commit 5b7fee0641

View File

@ -201,7 +201,7 @@ class Test_bgp(unittest.TestCase):
for f in files:
print('testing %s' % f)
binmsg = open(dir + f).read()
binmsg = open(dir + f, 'rb').read()
msg, rest = bgp.BGPMessage.parser(binmsg)
binmsg2 = msg.serialize()
eq_(binmsg, binmsg2)