From fb7c7171435e9f43cff0cd7a95f6a4a686e200c8 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Fri, 31 Jul 2026 17:15:08 +0200 Subject: [PATCH] shtab: exclude 1.8.2 and 1.9.0 releases 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 #9982 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f1d9bcac09..195a0da20e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,7 @@ dependencies = [ "platformdirs >=3.0.0, <5.0.0; sys_platform == 'darwin'", # for macOS: breaking changes in 3.0.0. "platformdirs >=2.6.0, <5.0.0; sys_platform != 'darwin'", # for others: 2.6+ works consistently. "argon2-cffi", - "shtab>=1.8.0", + "shtab>=1.8.0,!=1.8.2,!=1.9.0", # these generate broken zsh completions, see tqdm/shtab#224 "backports-zstd; python_version < '3.14'", # for python < 3.14. "jsonargparse>=4.47.0", "PyYAML>=6.0.2", # we need to register our types with yaml, jsonargparse uses yaml for config files