Skip to content

tests: use communicate() instead wait() #3001

@igaw

Description

@igaw

Tests written Python should be updated. There are many calls to Popen.wait() which is deprecated:

This will deadlock when using stdout=PIPE or stderr=PIPE and the child process generates enough output to a pipe such > that it blocks waiting for the OS pipe buffer to accept more data. Use Popen.communicate() when using pipes to avoid that.

        proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE,
                                encoding='utf-8')
        return proc.wait()

see Python documentation on wait: https://docs.python.org/3/library/subprocess.html#subprocess.Popen.wait

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions