shtab: exclude 1.8.2 and 1.9.0 releases - #9983
Merged
ThomasWaldmann merged 1 commit intoJul 31, 2026
Merged
Conversation
Both generate broken zsh completions: shtab replaced escape_zsh() with
shlex.quote() for the zsh help text, but still interpolates the result inside
a double-quoted _arguments spec. shlex.quote returns a self-contained shell
word (single-quoted, with ' written as '"'"'), which is only valid at top
level, so the quote parity flips and the rest of the spec goes unquoted.
Every description with a space gained stray literal quotes, and an apostrophe
anywhere left an unterminated quote that cascaded to shtab's own
default='*::: :->{name}', whose -> then parsed as a redirection:
$ borg completion zsh | zsh -n
(stdin):715: parse error near `>'
Our --sort-by help for `borg diff` contains '>size_added,path', which is what
tripped test_zsh_completion_syntax. Reported as tqdm/shtab#224, fix proposed
in tqdm/shtab#225; drop the exclusions once a release carries it.
Only CI jobs with a cold .tox cache saw this (macOS 15 first), since shtab was
unpinned above 1.8.0 -- cached envs kept the working 1.8.1.
Fixes borgbackup#9982
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #9983 +/- ##
==========================================
+ Coverage 85.84% 85.86% +0.01%
==========================================
Files 95 95
Lines 17056 17064 +8
Branches 2614 2614
==========================================
+ Hits 14642 14652 +10
+ Misses 1674 1673 -1
+ Partials 740 739 -1 ☔ View full report in Codecov by Harness. |
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.
Fixes #9982.
shtab 1.8.2 and 1.9.0 generate broken zsh completions, so exclude just those two releases (same shape as the existing
blake3>=1.0.0,!=1.0.9exclusion right below).Cause
shtab replaced
escape_zsh()withshlex.quote()for the zsh help text (tqdm/shtab@1590207) but still interpolates the result inside a double-quoted_argumentsspec.shlex.quotereturns a self-contained shell word — single-quoted, with'written as'"'"'— which is only valid at the top level. Inside"…"those quotes are literal, the parity flips, and the rest of the spec goes unquoted.Every description with a space gained stray literal quotes, and an apostrophe anywhere left an unterminated quote that cascaded down to shtab's own
default='*::: :->{name}', whose->then parsed as a redirection:Line 715 is our
borg diff --sort-byhelp, which contains'>size_added,path'— that's what trippedtest_zsh_completion_syntax.Why it looked macOS-only
Nothing platform-specific —
zsh -nis pure parsing, and our Linux CI does install zsh. shtab was unpinned above 1.8.0 and is absent fromdevelopment.lock.txt, while.toxis cached onhashFiles('…lock.txt', 'pyproject.toml'). Jobs hitting a warm cache kept the working 1.8.1; macOS 15 missed and resolved 1.8.2 fresh. The rest would have followed as caches expired.Touching
pyproject.tomlchanges that cache key, so this also busts the stale envs.Upstream
Reported as tqdm/shtab#224, fix proposed in tqdm/shtab#225 (green, unmerged at time of writing). Drop the exclusions once a release carries it.
Note the exclusion style is deliberate per TW:
!=1.8.2,!=1.9.0rather than<1.8.2, so a fixed 1.9.1+ is picked up automatically. The flip side is that a future release without the fix would be allowed again.Verification
test_zsh_completion_syntaxpasses again. (Locally twotest_bash_*_completiontests fail on this machine's bash 3.2 regardless of shtab version — unrelated, and they pass in CI.)