[issue43346] subprocess.run() sometimes ignores timeout in Windows

2021-06-28 Thread Zachary Ware
Change by Zachary Ware : -- nosy: +bugale bugale, eric.smith versions: +Python 3.11 ___ Python tracker ___ ___ Python-bugs-list mail

[issue43346] subprocess.run() sometimes ignores timeout in Windows

2021-02-28 Thread Eryk Sun
Eryk Sun added the comment: Demo Popen() methods, for discussion: def _read_output(self, fileobj): handle = msvcrt.get_osfhandle(fileobj.fileno()) output = self._fileobj2output[fileobj] while True: try: size = _winapi.PeekNamedPi

[issue43346] subprocess.run() sometimes ignores timeout in Windows

2021-02-28 Thread Eryk Sun
New submission from Eryk Sun : subprocess.run() handles TimeoutExpired by terminating the process and waiting on it. In POSIX, the exception object contains the partially read stdout and stderr bytes. For example: cmd = 'echo spam; echo eggs >&2; sleep 2' try: p = subprocess.run(cmd,