From fcbc99b41b2edfd35e53f0e7d1c5a4eabd94021b Mon Sep 17 00:00:00 2001 From: Ad Schellevis Date: Wed, 5 Feb 2020 19:08:46 +0100 Subject: [PATCH] parse_ports_log.py: python 3 compatibilty --- scripts/parse_ports_log.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/parse_ports_log.py b/scripts/parse_ports_log.py index 268e053..5456214 100755 --- a/scripts/parse_ports_log.py +++ b/scripts/parse_ports_log.py @@ -1,12 +1,13 @@ -#!/usr/bin/env python2.7 +#!/usr/bin/env python3.7 import collections import argparse from datetime import datetime def log_reader(filename): - with open(filename) as f_in: + with open(filename ,'rb') as f_in: for line in f_in: + line = line.decode() if len(line) >= 22 and line[0] == '[' and line[15] == ']' and line[1:15].isdigit() \ and line[17:21] == '===>' and line.find(' for ') > -1: if line.strip().endswith('for building'):