From cdea20a689db6b265f865a40a4d92c7a26f110fa Mon Sep 17 00:00:00 2001 From: Tib3rius <48113936+Tib3rius@users.noreply.github.com> Date: Wed, 28 Apr 2021 00:58:11 -0400 Subject: [PATCH] Update autorecon.py Fix for https://twitter.com/SandyF337/status/1387264368576917510 --- src/autorecon/autorecon.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/autorecon/autorecon.py b/src/autorecon/autorecon.py index 5b4c07f..e9bfd78 100755 --- a/src/autorecon/autorecon.py +++ b/src/autorecon/autorecon.py @@ -221,7 +221,12 @@ def calculate_elapsed_time(start_time): async def read_stream(stream, target, tag='?', patterns=[], color=Fore.BLUE): address = target.address while True: - line = await stream.readline() + line = "" + try: + line = await stream.readline() + except ValueError: + continue + if line: line = str(line.rstrip(), 'utf8', 'ignore') debug(color + '[' + Style.BRIGHT + address + ' ' + tag + Style.NORMAL + '] ' + Fore.RESET + '{line}', color=color) @@ -878,4 +883,3 @@ def main(): if __name__ == '__main__': main() -