Skip to content

fix(platform): read proc version with utf-8#3901

Merged
alteixeira20 merged 2 commits into
odysseus-dev:devfrom
Ghraven:fix/wsl-proc-version-encoding
Jun 11, 2026
Merged

fix(platform): read proc version with utf-8#3901
alteixeira20 merged 2 commits into
odysseus-dev:devfrom
Ghraven:fix/wsl-proc-version-encoding

Conversation

@Ghraven

@Ghraven Ghraven commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Summary

is_wsl() now reads /proc/version with explicit UTF-8 decoding and errors="ignore", matching the defensive proc/system-file reads already used elsewhere in the platform compatibility helpers. The existing WSL detection regression test now asserts that the tolerant read options are used.

Target branch

  • This PR targets dev, not main. All PRs land in dev; main is curated by the maintainer at each release. If your PR is on main by accident, click "Edit" on this PR and change the base.

Linked Issue

Closes #3902

Type of Change

  • Bug fix (non-breaking — fixes a confirmed issue)
  • New feature (non-breaking — adds new behaviour)
  • Breaking change (changes or removes existing behaviour)
  • Refactor / cleanup (behaviour unchanged)
  • Documentation only
  • CI / tooling / configuration

Checklist

  • I searched open issues and open PRs — this is not a duplicate.
  • This PR targets dev
  • My changes are limited to the scope described above — no unrelated refactors or whitespace changes mixed in.
  • I actually ran the app (docker compose up or uvicorn app:app) and verified the change works end-to-end. Type-checks and unit tests are not enough.

How to Test

  1. Run the focused WSL detection tests:
    .\\venv\\Scripts\\python.exe -m pytest tests/test_platform_compat.py::test_is_wsl_true_when_proc_version_mentions_microsoft tests/test_platform_compat.py::test_is_wsl_false_when_proc_version_is_not_microsoft tests/test_platform_compat.py::test_is_wsl_false_on_non_posix_without_proc_probe
  2. Confirm the tests pass; locally this returned 3 passed.
  3. Optionally run the full platform compatibility file. On my Windows checkout, that currently exposes an unrelated pre-existing failure in test_get_wsl_windows_user_profile_falls_back_to_users_dir.

Visual / UI changes — REQUIRED if you touched anything that renders

This PR does not touch UI, rendering, CSS, HTML, SVG, or static/js/ code.

Screenshots / clips

Not applicable; no visual changes.

@github-actions github-actions Bot added needs work PR description incomplete — please update before review ready for review Description complete — ready for maintainer review and removed needs work PR description incomplete — please update before review labels Jun 11, 2026

@alteixeira20 alteixeira20 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGFM. This is a tiny platform-compatibility fix: /proc/version is now read with explicit UTF-8 decoding and ignored decode errors, which is appropriate for WSL detection.

The regression test verifies the new open options, current CI is green, and the change is limited to the intended platform-detection path.

@alteixeira20
alteixeira20 merged commit 20cf94f into odysseus-dev:dev Jun 11, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Description complete — ready for maintainer review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Align WSL proc version read with explicit UTF-8 handling

2 participants