Skip to content

Commit

Permalink
Use shell=True in subprocess arguments to allow Lilypond to be on $PA…
Browse files Browse the repository at this point in the history
…THs with a ~
  • Loading branch information
aisipos committed Mar 19, 2013
1 parent 9b858a7 commit 5376600
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sebastian/core/elements.py
Expand Up @@ -101,10 +101,14 @@ def display(self, format="png"):
basename = f.name[:-len(suffix)]
args.extend(["-o"+basename, "-"])

p = sp.Popen(args, stdin=sp.PIPE)
p.communicate(write_lilypond.output(seq))
#Pass shell=True so that if your $PATH contains ~ it will
#get expanded. This also changes the way the arguments get
#passed in. To work correctly, pass them as a string
p = sp.Popen(" ".join(args), stdin=sp.PIPE, shell=True)
stdout, stderr = p.communicate(write_lilypond.output(seq))
if p.returncode != 0:
# there was an error
#raise IOError("Lilypond execution failed: %s%s" % (stdout, stderr))
return None

if not ipython:
Expand Down

0 comments on commit 5376600

Please sign in to comment.