Add cp850 encoding to subprocess

This commit is contained in:
TRGamer-tech 2021-08-06 10:50:46 +02:00 committed by Mike Salvatore
parent 8e9f5647f6
commit f2148db70b
1 changed files with 2 additions and 0 deletions

View File

@ -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())