
내 프로그램은 다음과 같습니다
import subprocess
subprocess.run(f"timeout -s 9 30 cat", shell=True)
그러나 tty의 입력에는 응답하지 않습니다.
시간 초과를 제거하거나 일반 tty 쉘에서 전체 명령을 실행하면 예상대로 작동합니다.
Python이 중단되는 원인은 무엇입니까?
환경:
$ uname -rv
5.10.0-13-amd64 #1 SMP Debian 5.10.106-1 (2022-03-17)
$ python3 --version
Python 3.9.2
$ bash --version
GNU bash, version 5.1.4(1)-release (x86_64-pc-linux-gnu)
$ dpkg -l | grep dash
ii dash 0.5.11+git20200708+dd9ef66-5 amd64 POSIX-compliant shell