Skip to content
Myr

Fix incorrect passing of flags to re.sub (#2581)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by GitHub · parents bb6a872, d69d210 · Browse files · 3 files+4 added−2 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

3 files+4 added−2 removed

  • other:+4 added−2 removed

3 files+4 added−2 removed

modified:src/click/_compat.py+1 added-1 removed
514 unmodified lines
515 return locale.getpreferredencoding()516517 _ansi_stream_wrappers: t.MutableMapping[t.TextIO, t.TextIO] = WeakKeyDictionary()518519 def auto_wrap_for_ansi(519 def auto_wrap_for_ansi( # noqa: F811520 stream: t.TextIO, color: t.Optional[bool] = None521 ) -> t.TextIO:522 """Support ANSI color and style codes on Windows by wrapping a523 stream with colorama.
100 unmodified lines
modified:src/click/shell_completion.py+1 added-1 removed
228 unmodified lines
229 def func_name(self) -> str:230 """The name of the shell function defined by the completion231 script.232 """233 safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), re.ASCII)233 safe_name = re.sub(r"\W*", "", self.prog_name.replace("-", "_"), flags=re.ASCII)234 return f"_{safe_name}_completion"235236 def source_vars(self) -> t.Dict[str, t.Any]:237 """Vars for formatting :attr:`source_template`.
356 unmodified lines
modified:CHANGES.rst+2 added
3 unmodified lines
4-------------56Unreleased78- Fix issue with regex flags in shell completion. :issue:`2581`91011Version 8.1.612-------------1314Released 2023-07-18
1090 unmodified lines