From 60c8c97a6c9713490165e8c4afb75e9ecb688a1e Mon Sep 17 00:00:00 2001 From: Oz Tiram Date: Sat, 26 Aug 2023 13:54:50 +0200 Subject: [PATCH] Fix usage of format_help (#5872) * Fix usage of format_help --- news/5872.bugfix.rst | 1 + pipenv/cli/command.py | 2 +- pipenv/utils/funktools.py | 3 +-- 3 files changed, 3 insertions(+), 3 deletions(-) create mode 100644 news/5872.bugfix.rst diff --git a/news/5872.bugfix.rst b/news/5872.bugfix.rst new file mode 100644 index 00000000..94cffb2b --- /dev/null +++ b/news/5872.bugfix.rst @@ -0,0 +1 @@ +Fix regression that caused printing non-printable ascii characters when help was called. diff --git a/pipenv/cli/command.py b/pipenv/cli/command.py index 3fdac109..5e7d88a7 100644 --- a/pipenv/cli/command.py +++ b/pipenv/cli/command.py @@ -189,7 +189,7 @@ def cli( # Check this again before exiting for empty ``pipenv`` command. elif ctx.invoked_subcommand is None: # Display help to user, if no commands were passed. - console.print(format_help(ctx.get_help())) + print(format_help(ctx.get_help())) @cli.command( diff --git a/pipenv/utils/funktools.py b/pipenv/utils/funktools.py index 45994454..de5668b0 100644 --- a/pipenv/utils/funktools.py +++ b/pipenv/utils/funktools.py @@ -71,8 +71,7 @@ def unnest(elem: Iterable) -> Any: for el in target: if isinstance(el, Iterable) and not isinstance(el, str): el, el_copy = tee(el, 2) - for sub in unnest(el_copy): - yield sub + yield from unnest(el_copy) else: yield el