Skip to content

Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.

Name the encoding when reading wslinfo's output (#9142)

Daniel Han900cd6a12882
diff --git a/studio/backend/lan_access.py b/studio/backend/lan_access.py
index 2a13710da15..7d3c9d7f3cf 100644
--- a/studio/backend/lan_access.py
+++ b/studio/backend/lan_access.py
@@ -129,6 +129,7 @@ def _wsl_networking_mode() -> Optional[str]:
capture_output = True,
check = False,
text = True,
+ encoding = "utf-8",
timeout = 1,
)
except (OSError, subprocess.SubprocessError):
diff --git a/studio/backend/tests/test_text_io_encoding.py b/studio/backend/tests/test_text_io_encoding.py
index 04f233d5e9a..33060b6bc85 100644
--- a/studio/backend/tests/test_text_io_encoding.py
+++ b/studio/backend/tests/test_text_io_encoding.py
@@ -309,9 +309,14 @@ def _offenders(path: Path) -> list[str]:
def test_text_io_names_its_encoding(path: Path) -> None:
offenders = _offenders(path)
assert not offenders, (
- "Text I/O without an explicit encoding falls back to the Windows ANSI "
- 'codepage and corrupts non-ASCII (ä ö ü → 世). Pass encoding = "utf-8":\n '
- + "\n ".join(offenders)
+ "Text I/O without an explicit encoding falls back to locale.getencoding(), "
+ "which is the ANSI codepage on Windows (cp1252, cp932, cp1251, ... by system "
+ "locale) and ASCII under a C or POSIX locale on Linux, as containers and CI "
+ "runners routinely have. Either way non-ASCII (ä ö ü → 世) mojibakes or raises "
+ "UnicodeDecodeError.\n\n"
+ "A platform guard above the call does NOT make this safe: the Windows codepage "
+ "is only one of the two ways to get the wrong decoder, and a linux-only path "
+ 'still meets the C-locale one. Pass encoding = "utf-8":\n ' + "\n ".join(offenders)
)