From 2157da7ac2de14337a06b3f650e8b24dddcfe580 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Mon, 19 Sep 2022 16:40:13 +0200 Subject: [PATCH 1/2] sniffer: correct handling of byte strings --- sniffer/tools/sniffer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sniffer/tools/sniffer.py b/sniffer/tools/sniffer.py index 98b9600..8f44868 100755 --- a/sniffer/tools/sniffer.py +++ b/sniffer/tools/sniffer.py @@ -56,10 +56,10 @@ def configure_interface(port, channel): line = "" iface = 0 - port.write(b'ifconfig\n') + port.write('ifconfig\n'.encode()) while True: line = port.readline() - if line == '': + if line == b'': print("Application has no network interface defined", file=sys.stderr) sys.exit(2) From 6346e8c78496f91d7f441aea24b2d28de95156a5 Mon Sep 17 00:00:00 2001 From: Martine Lenders Date: Tue, 20 Sep 2022 09:57:45 +0200 Subject: [PATCH 2/2] sniffer.py: enforce use of python3 --- sniffer/tools/sniffer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sniffer/tools/sniffer.py b/sniffer/tools/sniffer.py index 8f44868..9d29a51 100755 --- a/sniffer/tools/sniffer.py +++ b/sniffer/tools/sniffer.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- ''' (C) 2012, Mariano Alvira