Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/platform_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def is_wsl() -> bool:
import sys
if sys.platform.startswith("linux") or os.name == "posix":
try:
with open("/proc/version", "r") as f:
with open("/proc/version", "r", encoding="utf-8", errors="ignore") as f:
if "microsoft" in f.read().lower():
return True
except Exception:
Expand Down
1 change: 1 addition & 0 deletions tests/test_platform_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ def test_is_wsl_true_when_proc_version_mentions_microsoft(monkeypatch):
def fake_open(path, mode="r", *args, **kwargs):
assert path == "/proc/version"
assert mode == "r"
assert kwargs == {"encoding": "utf-8", "errors": "ignore"}
return io.StringIO("Linux version 6.6.0 microsoft standard")

monkeypatch.setattr("builtins.open", fake_open)
Expand Down
Loading