From f2148db70bc906b85e0be06fa5c8c0f25ff6d40a Mon Sep 17 00:00:00 2001 From: TRGamer-tech Date: Fri, 6 Aug 2021 10:50:46 +0200 Subject: [PATCH] Add cp850 encoding to subprocess --- monkey/infection_monkey/network/ping_scanner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/monkey/infection_monkey/network/ping_scanner.py b/monkey/infection_monkey/network/ping_scanner.py index 2f2b2719b..d01a9c56b 100644 --- a/monkey/infection_monkey/network/ping_scanner.py +++ b/monkey/infection_monkey/network/ping_scanner.py @@ -43,11 +43,13 @@ class PingScanner(HostScanner, HostFinger): if not "win32" == sys.platform: timeout /= 1000 + Encoding = "cp850" sub_proc = subprocess.Popen( ["ping", PING_COUNT_FLAG, "1", PING_TIMEOUT_FLAG, str(timeout), host.ip_addr], stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True, + encoding=Encoding, ) output = " ".join(sub_proc.communicate())