EllipsisMiddleTruncate exceeds requested width when only the ellipsis fits
@hugosmoreira がすでに取り組んでいます。
2026年10月26日 から。
評価
調査の方向性
fire/formatting.pyから始めてEllipsisMiddleTruncateを調べ、長さがゼロの後半部分と、切り詰めが発生しない境界に注目してください。issueの2つの例を再現し、出力が指定された幅以内に収まり、ちょうど収まる文字列が保持されることを確認してください。
索引モデルが issue の本文から書いたものです。
説明
EllipsisMiddleTruncate returns more characters than the requested width when available_space is 3. It also modifies strings that already fit exactly within the specified width.
Steps to reproduce
from fire import formatting
print(formatting.EllipsisMiddleTruncate('abcdefghij', 3, 80))
# Actual: '...abcdefghij'
# Expected: '...'
print(formatting.EllipsisMiddleTruncate('abcd', 4, 80))
# Actual: '...d'
# Expected: 'abcd'
Cause
The expression text[-second_half_len:] returns the entire string when second_half_len is zero. The no-truncation check also uses < instead of <=.
Expected behavior
Output should respect the available width, and strings that already fit should remain unchanged.
Verification
Reproduced using the implementation from fire/formatting.py.
- 主要言語
- Python
- スター
- 28.2k
- フォーク
- 1.5k
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
google/python-fire のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
google/python-fire#733 ·
-
External pager resets custom SIGINT handlers to SIG_DFL対応中かも @hugosmoreira が 14 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
google/python-fire#723 · コメント 1 件 ·
-
Windows ANSI initialization uses nonexistent subprocess.STD_OUTPUT_HANDLE対応中かも @Fire162 が 11 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
google/python-fire#721 · コメント 1 件 ·
-
Setup docs still say `python setup.py install`, but `setup.py` was removed対応中かも @GreedyC が 18 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 93/100
google/python-fire#718 · コメント 1 件 ·
-
Calling an async command from an active event loop raises RuntimeError and leaves an unawaited coroutine対応中かも @aashish254 が 20 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
google/python-fire#716 ·
google/python-fire の issue をすべて見る
似ている issue
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
stephrobert/dsoxlab#354 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 77/100
jasonacox/pypowerwall#472 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: DoubleMLRDDData accepts a score_col that is no data column (as in its docstring example); the running variable then becomes a covariate and RDFlex fails対応中かも @vrjdev が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
DoubleML/doubleml-for-py#455 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Python mod.Box[T] annotation gets a false generic_arg edge that replaces the parameter_type one ('is' on tree-sitter nodes)対応中かも @rohit-jsfreaky が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
Graphify-Labs/graphify#5110 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
assafelovic/gpt-researcher#2277 ·
メンテナーはふだん 10 日以内に返信