I found and fixed a Windows-specific pre-commit failure in check-old-precice.py.
Problem
check-old-precice.py used Path.read_text() without explicit encoding.
On Windows, this can default to CP1252 and crash on UTF-8 markdown files with:
UnicodeDecodeError: ‘charmap’ codec can’t decode byte …
Fix
-
read old-precice.txt with encoding=“utf-8”
-
read scanned files with encoding=“utf-8”, errors=“replace”
This makes behavior deterministic across platforms and prevents Windows-only crashes.
Validation
Ran successfully:
Ready branch
-
Branch: Flamki:issue-windows-encoding-check-old-precice
-
Commit: 6152e13826f
-
Compare link:
Comparing precice:master...Flamki:issue-windows-encoding-check-old-precice · precice/precice.github.io · GitHub
I could not open a PR directly because repo interactions are restricted to collaborators for my account.