watts icon indicating copy to clipboard operation
watts copied to clipboard

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

Open samgdotson opened this issue 3 years ago • 0 comments

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.

samgdotson avatar Jun 23 '22 22:06 samgdotson