Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test_subprocess_pipe fails with ProcessLookupError #1125

Closed
socram8888 opened this issue May 29, 2018 · 0 comments
Closed

test_subprocess_pipe fails with ProcessLookupError #1125

socram8888 opened this issue May 29, 2018 · 0 comments

Comments

@socram8888
Copy link
Contributor

Steps to reproduce

  1. Install a dev setup as specified in CONTRIBUTING.rst

  2. 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```
@github-actions github-actions bot locked and limited conversation to collaborators Aug 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant