External pager resets custom SIGINT handlers to SIG_DFL
評価
調査の方向性
More() から始めて、fire/console/console_io.py で外部ページャーの実行方法と例外の処理方法を確認してください。SIGINT が無視される前に有効なハンドラーを保存し、例外が発生した場合も含め、ページャーの終了後に確実に復元してください。どちらの場合も以前のハンドラーがインストールされたままであれば完了です。issue にはテストファイルが示されていないため、この動作に適したテストを特定してください。
索引モデルが issue の本文から書いたものです。
説明
In fire/console/console_io.py, the More() function temporarily ignores SIGINT while an external pager runs.
However, it restores SIG_DFL instead of the handler previously installed by the application.
Problematic code
signal.signal(signal.SIGINT, signal.SIG_IGN)
# Execute external pager
signal.signal(signal.SIGINT, signal.SIG_DFL)
Expected behavior
The function should preserve the existing signal handler and restore it after the pager exits, including when an exception occurs.
Actual behavior
Based on the code, applications using custom SIGINT handlers lose their original handler after pager execution. Exceptions may also leave SIGINT ignored.
Suggested fix
Save the original handler and restore it in a finally block.
Testing
Identified through source-code inspection. An interactive pager reproduction has not yet been executed.
- 主要言語
- 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 ·
-
EllipsisMiddleTruncate exceeds requested width when only the ellipsis fits対応中かも @hugosmoreira が 14 日前に担当しました。 オープン
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
google/python-fire#722 · コメント 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 日以内に返信