Skip to content

WIP: Fix HelpFormatter.write_usage producing spurious characters#3434

Merged
Rowlando13 merged 1 commit into
pallets:mainfrom
kdeldycke:fix-3360-write-usage-empty-args
May 16, 2026
Merged

WIP: Fix HelpFormatter.write_usage producing spurious characters#3434
Rowlando13 merged 1 commit into
pallets:mainfrom
kdeldycke:fix-3360-write-usage-empty-args

Conversation

@kdeldycke
Copy link
Copy Markdown
Collaborator

@kdeldycke kdeldycke commented May 16, 2026

This cleans-up the way the usage line is produce in the help by stripping all spurious trailing spaces produced by various parameters and indention setup. Also normalizes the second whitespace-only line that is used as separator for that section of the help screen.

Closes #3360.

The other related bug #1550 I mentioned in #3360 (comment) has been fixed in an unrelated commit a while ago. But use the opportunity to cover that case in the new test suite.

@kdeldycke kdeldycke added bug f:help feature: help text labels May 16, 2026
@kdeldycke kdeldycke added this to the 8.4.0 milestone May 16, 2026
@kdeldycke kdeldycke marked this pull request as draft May 16, 2026 06:26
@kdeldycke kdeldycke marked this pull request as ready for review May 16, 2026 06:38
@kdeldycke kdeldycke requested review from Rowlando13 and davidism May 16, 2026 06:38
@kdeldycke
Copy link
Copy Markdown
Collaborator Author

This PR is ready to be reviewed and merged upstream.

@kdeldycke kdeldycke force-pushed the fix-3360-write-usage-empty-args branch from 9d43f96 to 0551bf5 Compare May 16, 2026 06:39
@Rowlando13 Rowlando13 merged commit 3bb230d into pallets:main May 16, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug f:help feature: help text

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Empty output from HelpFormatter.write_usage for a program without arguments

2 participants