From e828091c2555379fc743b73a8143d4119b5593bc Mon Sep 17 00:00:00 2001 From: David Foucher Date: Sun, 23 Oct 2022 01:12:56 +0200 Subject: [PATCH] Fix ping module with LANG fixed to C --- i3pystatus/ping.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/i3pystatus/ping.py b/i3pystatus/ping.py index 984b832d..01b361a6 100644 --- a/i3pystatus/ping.py +++ b/i3pystatus/ping.py @@ -1,3 +1,4 @@ +import os import subprocess from i3pystatus import IntervalModule @@ -62,7 +63,7 @@ def switch_state(self): def ping_host(self): p = subprocess.Popen(["ping", "-c1", "-w%d" % self.interval, self.host], stdout=subprocess.PIPE, - stderr=subprocess.DEVNULL) + stderr=subprocess.DEVNULL, env=dict(os.environ, LC_ALL="C")) out, _ = p.communicate() if p.returncode == 0: return float(out.decode().split("\n")[1]