Skip to content

Commit

Permalink
Fix ping module with LANG fixed to C
Browse files Browse the repository at this point in the history
  • Loading branch information
tyjak committed Aug 15, 2024
1 parent f3c539a commit e828091
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion i3pystatus/ping.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import subprocess

from i3pystatus import IntervalModule
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit e828091

Please sign in to comment.