mirror of
https://github.com/sshuttle/sshuttle.git
synced 2025-02-16 10:29:36 +01:00
windows: ignore netstat output encoding errors
This commit is contained in:
parent
554b8e3ae5
commit
df9625bbfd
@ -294,7 +294,7 @@ class Method(BaseMethod):
|
|||||||
|
|
||||||
def _get_bind_address_for_port(self, port, family):
|
def _get_bind_address_for_port(self, port, family):
|
||||||
proto = "TCPv6" if family.version == 6 else "TCP"
|
proto = "TCPv6" if family.version == 6 else "TCP"
|
||||||
for line in subprocess.check_output(["netstat", "-a", "-n", "-p", proto]).decode().splitlines():
|
for line in subprocess.check_output(["netstat", "-a", "-n", "-p", proto]).decode(errors='ignore').splitlines():
|
||||||
try:
|
try:
|
||||||
_, local_addr, _, state, *_ = re.split(r"\s+", line.strip())
|
_, local_addr, _, state, *_ = re.split(r"\s+", line.strip())
|
||||||
except ValueError:
|
except ValueError:
|
||||||
|
Loading…
Reference in New Issue
Block a user