From eec51c83614b741aa27a10a02b1678ec3729ca03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Date: Tue, 14 Apr 2020 09:17:03 +0200 Subject: [PATCH] Fix handling /proc/cpuinfo without tabs /proc/cpuinfo uses spaces rather than tabs on ia64. Since there seems not to be any reason to require specific kind of whitespace before ':' on 'cpu mhz' line, just split on ':'. See: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/ia64/kernel/setup.c#n700 --- psutil/_pslinux.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index 9e32f25e7..4fb783d14 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -716,7 +716,7 @@ def cpu_freq(): with open_binary('%s/cpuinfo' % get_procfs_path()) as f: for line in f: if line.lower().startswith(b'cpu mhz'): - key, value = line.split(b'\t:', 1) + key, value = line.split(b':', 1) ret.append(_common.scpufreq(float(value), 0., 0.)) return ret