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 檔案
- 沒有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 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
-
難度 1/5 1-3 小時 新手友好度 76/100
維護者通常 1 天內回覆
-
bug documentation good first issue help wanted testing
難度 2/5 1-3 小時 新手友好度 84/100
維護者通常 1 天內回覆
-
Show evidence time and supersede warnings in the memory inspector可能已有人在做 @Sinchanak-212 今天認領。 未關閉area: ux good first issue priority: medium
難度 2/5 1-3 小時 新手友好度 84/100
-
難度 1/5 1 小時以內 新手友好度 86/100
daniel-ospina/tortoise#11649 ·
維護者通常 1 天內回覆
-
難度 1/5 1 小時以內 新手友好度 86/100
ComposioHQ/awesome-claude-skills#2438 ·
維護者通常 15 天內回覆