{Misc.} Fix help % token handling for Python 3.14 argparse compatibility#300
Open
YangAn-microsoft wants to merge 1 commit intomicrosoft:devfrom
Open
{Misc.} Fix help % token handling for Python 3.14 argparse compatibility#300YangAn-microsoft wants to merge 1 commit intomicrosoft:devfrom
% token handling for Python 3.14 argparse compatibility#300YangAn-microsoft wants to merge 1 commit intomicrosoft:devfrom
Conversation
8 tasks
% token handling for Python 3.14 argparse compatibility% token handling for Python 3.14 argparse compatibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes Knack help rendering for
%-based help strings to keep behavior stable with Python 3.14 argparse validation.Why this is needed (Python 3.14)
Python 3.14 argparse performs stricter help-format validation.
Help text containing unescaped literal
%can raise formatting errors during help processing.Since Knack renders help through custom paths, we must handle these cases safely while preserving argparse placeholder semantics.
What changed
%sanitization for argparse-facing help text.%does not crash help rendering.%(default)s%(prog)s%%%fallback behaviorResulting behavior
%(default)sexpands to the argument default value.%(prog)sexpands to the parser program string.%%is rendered as%.%does not crash and is shown as%.Validation
245 passed).Scope
This is a focused compatibility and robustness fix for help rendering behavior under Python 3.14.