From ee0bf7cd9b4bbd400e715681db8b1df153e5dc98 Mon Sep 17 00:00:00 2001 From: Stefan Marr Date: Sat, 9 Nov 2024 13:46:26 +0000 Subject: [PATCH] Make encoding explicit Signed-off-by: Stefan Marr --- rebench/denoise.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rebench/denoise.py b/rebench/denoise.py index 674405cf..ec7f1347 100644 --- a/rebench/denoise.py +++ b/rebench/denoise.py @@ -191,7 +191,9 @@ def _reset_shielding() -> Union[str, bool]: def _read_scaling_governor() -> Optional[str]: try: with open( - "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", "r", encoding="utf-8" + "/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor", + "r", + encoding="utf-8", ) as gov_file: return gov_file.read().strip() except IOError: @@ -220,8 +222,9 @@ def _set_scaling_governor(governor, num_cores) -> str: def _read_no_turbo() -> Optional[bool]: try: - # pylint: disable-next=unspecified-encoding - with open("/sys/devices/system/cpu/intel_pstate/no_turbo", "r") as nt_file: + with open( + "/sys/devices/system/cpu/intel_pstate/no_turbo", "r", encoding="utf-8" + ) as nt_file: return nt_file.read().strip() == "1" except IOError: return None