Skip to content

Commit

Permalink
Make encoding explicit
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Marr <[email protected]>
  • Loading branch information
smarr committed Nov 9, 2024
1 parent 6c5c451 commit ee0bf7c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions rebench/denoise.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ee0bf7c

Please sign in to comment.