External pager resets custom SIGINT handlers to SIG_DFL
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 82/100
Direção de pesquisa
Comece com More() em fire/console/console_io.py e examine como o pager externo é executado e como as exceções são tratadas. Salve o handler ativo antes de SIGINT ser ignorado e, em seguida, garanta que ele seja restaurado após a saída do pager, inclusive em caso de exceções. A tarefa estará concluída quando o handler anterior continuar instalado em ambos os casos; o issue não fornece um arquivo de teste, então identifique um teste adequado para esse comportamento.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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.
- Linguagem predominante
- Python
- Estrelas
- 28.2k
- Forks
- 1.5k
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de google/python-fire
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 70/100
google/python-fire#733 ·
-
EllipsisMiddleTruncate exceeds requested width when only the ellipsis fitsTalvez já em andamento @hugosmoreira assumiu há 14 dias. Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 88/100
google/python-fire#722 · 1 comentário ·
-
Windows ANSI initialization uses nonexistent subprocess.STD_OUTPUT_HANDLETalvez já em andamento @Fire162 assumiu há 11 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
google/python-fire#721 · 1 comentário ·
-
Setup docs still say `python setup.py install`, but `setup.py` was removedTalvez já em andamento @GreedyC assumiu há 18 dias. Aberta
Dificuldade 1/5 1-3 horas Facilidade para iniciantes 93/100
google/python-fire#718 · 1 comentário ·
-
Calling an async command from an active event loop raises RuntimeError and leaves an unawaited coroutineTalvez já em andamento @aashish254 assumiu há 20 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
google/python-fire#716 ·
Todas as issues de google/python-fire
Issues semelhantes
-
Document style: tablesAberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 66/100
-
Successor registrant to review: Navient Holdings, Inc. (CIK 2152623), 8-K12B 0001193125-26-436899Abertasuccessor-review
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 78/100
dgunning/edgartools#1889 ·
Mantenedores costumam responder em até 1 dia
-
`destroy` sans terminal répond « Aborted. » au lieu de réclamer `--yes` comme `clean` et `reset`Abertabug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
stephrobert/dsoxlab#354 ·
Mantenedores costumam responder em até 1 dia
-
hardware help wanted testing
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
mediajunkie/piper-morgan-product#2335 · 1 comentário ·