From 9ad2e321eda649561b5e2651c1380fefb80f94c8 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Thu, 30 Apr 2026 07:38:06 +0200 Subject: [PATCH 1/3] Add missing changelog entries Refs: #3372 --- CHANGES.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 76f2b0066..0c8e2a297 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -17,6 +17,9 @@ Unreleased ``dict[str, Any]``. - :class:`CompositeParamType` and the number-range base are now generic with abstract methods. +- Refactor ``convert_type`` to extract type inference into a private + ``_guess_type`` helper, and add :func:`typing.overload` signatures. + :pr:`3372` - :class:`Parameter` typing improvements. :pr:`2805` - :class:`Parameter` is now an abstract base class, making explicit From 15b34e8438753d4ffe09666878bc0cfb071a63ba Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Thu, 30 Apr 2026 08:15:34 +0200 Subject: [PATCH 2/3] Cleanup #3126 Link to PR in changelog, move implementation details to Python code, fix changed version and align `.gitignore` syntax --- .gitignore | 2 +- CHANGES.rst | 2 +- src/click/shell_completion.py | 17 +++++++++-------- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/.gitignore b/.gitignore index 47b0bed4e..9b0339754 100644 --- a/.gitignore +++ b/.gitignore @@ -6,4 +6,4 @@ dist/ htmlcov/ .tox/ docs/_build/ -.venv +.venv/ diff --git a/CHANGES.rst b/CHANGES.rst index 0c8e2a297..4b739bd72 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -49,7 +49,7 @@ Unreleased replacing the ``start`` built-in which cannot be invoked without ``shell=True``. :issue:`3164` :pr:`3186` - Fix Fish shell completion errors when option help text contains newlines. - :issue:`3043` + :issue:`3043` :pr:`3126` - Add :class:`NoSuchCommand` exception with suggestions for misspelled commands. :issue:`3107` :pr:`3228` - Add ``click.get_pager_file`` for file-like access to an output diff --git a/src/click/shell_completion.py b/src/click/shell_completion.py index 5a89b64ec..7235f1009 100644 --- a/src/click/shell_completion.py +++ b/src/click/shell_completion.py @@ -421,15 +421,16 @@ def get_completion_args(self) -> tuple[list[str], str]: return args, incomplete def format_completion(self, item: CompletionItem) -> str: - """Format completion item for Fish shell. - - Escapes newlines in both value and help text to prevent - Fish shell parsing errors. - - .. versionchanged:: 8.3 - Escape newlines in help text to fix completion errors - with multi-line help strings. """ + .. versionchanged:: 8.4 + Escape newlines in value and help to fix completion errors with + multi-line help strings. + """ + # The fish completion script splits each response line on literal + # newlines, so any newline in the value or help would corrupt the + # frame. Replace them with the two-character escape "\n" so the text + # round-trips through fish without breaking the format. The "_" + # sentinel for missing help mirrors :class:`ZshComplete`. help_ = item.help or "_" value = item.value.replace("\n", r"\n") help_escaped = help_.replace("\n", r"\n") From 516e141dd59b3e4a3dcd01c3e92d85e77e7d6733 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Fri, 8 May 2026 06:57:22 +0200 Subject: [PATCH 3/3] Add missing changelog entry Refs: #2902 --- CHANGES.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGES.rst b/CHANGES.rst index 4b739bd72..a8dbe8c82 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -54,6 +54,8 @@ Unreleased commands. :issue:`3107` :pr:`3228` - Add ``click.get_pager_file`` for file-like access to an output pager. :pr:`1572` +- Mark additional built-in strings with ``gettext()`` to extend translation + coverage. :pr:`2902` Version 8.3.3 -------------