fix(fuse): make cli.py parse under Python 3.11#544
Merged
Conversation
fuse declares requires-python >=3.11, but cli.py line 577 put a backslash
(and the delimiter quote) inside an f-string replacement field — both
forbidden in f-string expressions before 3.12 (PEP 701). Under 3.11 the module
fails to even parse, so kg-fuse can't be imported and the docs deploy's
generate-fuse-docs.py (runs on 3.11) aborts with SyntaxError.
The f"{...}" wrapper was pointless — it only interpolated a single _dim() call
— so drop it. The double quotes around "systemd" then live in a plain
single-quoted string and need no escaping. Verified: all fuse modules compile
under CPython 3.11.15.
Claude-Session: https://claude.ai/code/session_017Her5fGimBvtzYD4q9tNnf
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.
Why
After #543 unblocked the CLI build in the docs deploy, the workflow reached the next latent failure:
generate-fuse-docs.py(runs on Python 3.11)ast.parse()sfuse/kg_fuse/cli.py, which has an f-string with a backslash and the delimiter quote inside the{…}expression — both forbidden before 3.12 (PEP 701). Since fuse declaresrequires-python = ">=3.11", this is a real latent bug:kg-fusewon't import on 3.11 at all.Fix
The
f"{_dim(...)}"wrapper only interpolated a single call, so drop it →_dim('…'). The"systemd"quotes then sit in a plain single-quoted string, no escaping needed. Message text unchanged.Verification
uv run --python 3.11compile-checked all 32 fuse modules → clean (was: SyntaxError at cli.py:577).Second of the two fast CI fixes before the schema-diagram docs work (follows #543).
https://claude.ai/code/session_017Her5fGimBvtzYD4q9tNnf