🐛 FIX: Windows pytest fails on backslash in TOML basic string#2
Merged
Conversation
``test_absolute_paths_pass_through_unchanged`` interpolated a ``tmp_path``-derived absolute path into a TOML **basic** string. On Windows that path looks like ``C:\Users\runneradmin\AppData\Local\ ...``; the TOML parser reads ``\U`` as the start of a ``\Uxxxxxxxx`` Unicode escape, expects 8 hex digits, finds ``sers...`` instead, and fails with ``Invalid hex value (at line 2, column 12)`` before ``load_mounts_from_toml`` even returns. Every other CI cell passed. Switch the two interpolated values to TOML **literal** strings (single quotes), where backslashes are taken verbatim and no escape processing happens. The round-trip assertion still holds — literal strings preserve their content byte-for-byte, so the absolute path the test wrote is exactly what the TOML loader gives back. Unblocks the Windows pytest cell of the ci.yml workflow, which is currently red on ``main`` and on PR #1 (dependabot setup-uv 6→7); PR #1 only surfaced this pre-existing test bug, it did not cause it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
tests/test_config.py::TestLoadMountsFromToml::test_absolute_paths_pass_through_unchangedinterpolated a Windowstmp_path(C:\Users\runneradmin\AppData\Local\…) into a TOML basic string. The TOML parser sees\Uand tries to read 8 hex digits for a\Uxxxxxxxxescape, findssers…, and raisesInvalid hex value (at line 2, column 12)beforeload_mounts_from_tomlreturns.ci.yml, currently red onmainand on build(deps): bump astral-sh/setup-uv from 6 to 7 #1 (dependabotsetup-uv6→7). build(deps): bump astral-sh/setup-uv from 6 to 7 #1 only surfaces this pre-existing test bug; it did not cause it.Failure on
main(run 26251744910)Test plan
uv run pytest tests/test_config.py -q(Linux) — 58 passeduv run --frozen prek run --all-files— all hooks passmainafter merge → all green