Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ Version 8.1.7

Unreleased

- Fix issue with regex flags in shell completion. :issue:`2581`


Version 8.1.6
-------------
Expand Down
2 changes: 1 addition & 1 deletion src/click/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ def _get_argv_encoding() -> str:

_ansi_stream_wrappers: t.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary()

def auto_wrap_for_ansi(
def auto_wrap_for_ansi( # noqa: F811
stream: t.TextIO, color: t.Optional[bool] = None
) -> t.TextIO:
"""Support ANSI color and style codes on Windows by wrapping a
Expand Down
2 changes: 1 addition & 1 deletion src/click/shell_completion.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ def func_name(self) -> str:
"""The name of the shell function defined by the completion
script.
"""
safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), re.ASCII)
safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), flags=re.ASCII)
return f"_{safe_name}_completion"

def source_vars(self) -> t.Dict[str, t.Any]:
Expand Down