From 48688e675db3812a6476541adc56107d55ad4203 Mon Sep 17 00:00:00 2001 From: Valdur Kana Date: Thu, 10 Oct 2024 17:01:00 +0300 Subject: [PATCH] hddtemp: remove deprecated telnetlib dependency (fixes #2261) --- py3status/modules/hddtemp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py3status/modules/hddtemp.py b/py3status/modules/hddtemp.py index 1d5fd9d280..2cf740e3a6 100644 --- a/py3status/modules/hddtemp.py +++ b/py3status/modules/hddtemp.py @@ -36,6 +36,8 @@ Requires: hddtemp: utility to monitor hard drive temperatures + netcat: (nc) is a command-line utility for reading + data from hddtemp telnet interface Bible of HDD failures: Hard disk temperatures higher than 45°C led to higher failure rates. @@ -108,7 +110,6 @@ """ from string import printable -from telnetlib import Telnet class Py3status: @@ -135,7 +136,7 @@ def post_config_hook(self): self.thresholds_init = self.py3.get_color_names_list(self.format_hdd) def hddtemp(self): - line = Telnet("localhost", 7634).read_all().decode("utf-8", "ignore") + line = self.py3.command_output("nc localhost 7634") new_data = [] for chunk in line[1:-1].split("||"):