Skip to content

Instantly share code, notes, and snippets.

@roaet
Created October 2, 2018 02:59
Show Gist options
  • Save roaet/4ec1f42e81788c96446de6937958af59 to your computer and use it in GitHub Desktop.
Save roaet/4ec1f42e81788c96446de6937958af59 to your computer and use it in GitHub Desktop.
.....
stdoutPipe = subprocess.PIPE # line 722 of Gardener.py
stderrPipe = subprocess.PIPE
if platform.platform().lower().startswith('windows'):
if printerrKey in commandDict and commandDict[printerrKey]:
stdoutPipe = None
else:
stderrPipe = None
import shlex # move to top of course
command = shlex.split(command)
process = subprocess.Popen(command, shell=True, stdout=stdoutPipe, stderr=stderrPipe)
if platform.platform().lower().startswith('windows'):
# Windows has issues with the normal way we're getting the lines from the output.
# os.fstat() always reports the pipe has a size of 0.
# file.readline() waits for a lotp of lines to be ready.
# For some reason, iter() doesn't have this problem.
if printerrKey in commandDict and commandDict[printerrKey]:
printPipe = process.stderr
.......
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment