-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Closed
Description
Steps to reproduce
-
Install a dev setup as specified in CONTRIBUTING.rst
-
Run
make test
Expected behaviour
Tests should pass
Actual behaviour
test_subprocess_pipe fails with ProcessLookupError. The process finishes before the os.kill call is made, and thus the exception is being raised.
Configuration
Operating System: Ubuntu 16.04 on Windows 10
Version of Python, python-telegram-bot & dependencies: Python 3.5.2, bot on commit 42daf96 (latest available)
Logs
____________________________________________________________________________________________________ TestInputFile.test_subprocess_pipe _____________________________________________________________________________________________________
self = <tests.test_inputfile.TestInputFile object at 0x7ff6fce846a0>
def test_subprocess_pipe(self):
if sys.platform == 'win32':
cmd = ['type', self.png]
else:
cmd = ['cat', self.png]
proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=(sys.platform == 'win32'))
in_file = InputFile({'photo': proc.stdout})
assert in_file.input_file_content == open(self.png, 'rb').read()
assert in_file.mimetype == 'image/png'
assert in_file.filename == 'image.png'
> proc.kill()
tests/test_inputfile.py:43:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3.5/subprocess.py:1787: in kill
self.send_signal(signal.SIGKILL)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <subprocess.Popen object at 0x7ff6fce84550>, sig = <Signals.SIGKILL: 9>
def send_signal(self, sig):
"""Send a signal to the process."""
# Skip signalling a process that we know has already died.
if self.returncode is None:
> os.kill(self.pid, sig)
E ProcessLookupError: [Errno 3] No such process
/usr/lib/python3.5/subprocess.py:1777: ProcessLookupError```
Metadata
Metadata
Assignees
Labels
No labels