Skip to content

Using communicate() rather than read() in fileutils.run() #49

@samgdotson

Description

@samgdotson

I'm in the process of developing an ABCE plugin for watts (#48 ) yet, when I run ABCE via watts, the program hangs.

I narrowed the problem down to run() in fileutils.py. Specifically, the program hangs after stdout_data = p.stdout.read() is called.

p = subprocess.Popen(args, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
                         universal_newlines=True)

while True:
    select.select([p.stdout, p.stderr], [], [])

    stdout_data = p.stdout.read()
    stderr_data = p.stderr.read()

I think this should be changed to communicate() per the subprocess documentation.

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