Repository navigation
Include labels in fast progress bar width - #331
Merged
wolph merged 1 commit intoNov 1, 2026
Merged
Conversation
wolph
added a commit
that referenced
this pull request
Nov 1, 2026
…e fast path after #331 4.6.0 rendered prefix and suffix through an f-string and never called custom_len on the fast path. #331 concatenates the labels and calls custom_len for the width, so an int label raised TypeError and custom_len=None or a float-returning custom_len raised. Stringify the labels, fall back to len_color for an uncallable custom_len and truncate its result to int. Tests pin the three cases.
Owner
|
Thank you for the fix! Overflowing the terminal with a label was a 4.6.0 regression, so this brings it back to what 4.5.0 did. I've added a small guard that keeps non-str labels and an uncallable |
wolph
added a commit
that referenced
this pull request
Nov 1, 2026
tox 4.67.5 rejects an empty changedir ("path value is empty"), which
turned the docs, docs-demos, readme and console jobs red on develop and
on #331. The five envs that left it empty now say {toxinidir}, which is
what the empty value meant.
Contributor
Author
|
I checked the formatter guard with the existing 31 focused tests; they pass, including non-string labels and a non-callable custom_len. I also reproduced the empty changedir failure with tox 4.67.5. Your 05a60c9 fix resolves that configuration error, and docs, docs-demos and the strict README build now pass locally on CPython 3.13.14. The hosted checks still need their own result. |
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.
The known-length fast bar allocates the whole terminal width to its status and bar, then adds
prefix/descandsuffix. An ordinary labeled bar can overflow an 80-column terminal to 95 columns.Reserve the measured fixed text before sizing the filler. Use the existing
custom_lencallback so ANSI colors and custom display widths are handled consistently.CPython 3.13.14 / macOS arm64 validation:
Fixed text wider than the terminal is still not truncated. Optional custom/native formatter hooks are unchanged; other platform/runtime combinations and hosted CI remain unverified locally.