Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix usage of format_help #5872

Merged
merged 3 commits into from
Aug 26, 2023
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
1 change: 1 addition & 0 deletions news/5872.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix regression that caused printing non-printable ascii characters when help was called.
2 changes: 1 addition & 1 deletion pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
3 changes: 1 addition & 2 deletions pipenv/utils/funktools.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually have a bigger refactor/simplification of this method in my open PR that will conflict with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well. Then let's merge this with out caring for ruff. We'll fix ruff in the next PRs

else:
yield el

Expand Down