Martijn Pieters added the comment:
Apologies, I copied the wrong sleep 10 demo. The correct demo is:
cat >test.sh<<EOF
> #!/bin/sh
> sleep 10
> EOF
time bin/python -c "import subprocess; subprocess.run(['./test.sh'],
stderr=subprocess.PIPE, timeout=3)"
Traceback (most recent call last):
File
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py",
line 405, in run
stdout, stderr = process.communicate(input, timeout=timeout)
File
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py",
line 836, in communicate
stdout, stderr = self._communicate(input, endtime, timeout)
File
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py",
line 1497, in _communicate
self._check_timeout(endtime, orig_timeout)
File
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py",
line 864, in _check_timeout
raise TimeoutExpired(self.args, orig_timeout)
subprocess.TimeoutExpired: Command '['./test.sh']' timed out after 3 seconds
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File
"/Users/mjpieters/Development/Library/buildout.python/parts/opt/lib/python3.6/subprocess.py",
line 410, in run
stderr=stderr)
subprocess.TimeoutExpired: Command '['./test.sh']' timed out after 3 seconds
real 0m10.054s
user 0m0.033s
sys 0m0.015s
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue30154>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com