lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: windows lilypond-book.py


From: Michael Welsh Duggan
Subject: Re: windows lilypond-book.py
Date: Sat, 14 Jan 2012 11:02:59 -0500
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.92 (gnu/linux)

Graham Percival <address@hidden> writes:

> On Sat, Jan 14, 2012 at 10:31:43AM -0000, Trevor Daniels wrote:
>> 
>> Graham, you wrote Saturday, January 14, 2012 9:43 AM
>> 
>> >I expect 1 and 2 to work.  If 3 works, we're golden.  If 4
>> >succeeds then something weirder than I think is happening.
>> 
>> Well, 1 works fine, printing out the directory and return code 0
>> but 2 just hangs in the wait(), so nothing is printed.  I have to
>> CTRL-C to recover the terminal.
>
> srsly?!  I really wasn't expect that!
>
> For anybody wanting a quick refresh, this is what hangs:
>     cmd = "dir"
>     proc = subprocess.Popen(cmd, shell=True,
>         stdout=subprocess.PIPE)
>     ret = proc.wait()
>     print "2. return code: ", ret

Having it hang in the wait makes sense, unless the directory is very
small.  You aren't draining the pipe.  Dir is probably blocked on write,
since the pipe is full.  It won't exit unless you read the data from
proc.stdout.  Maybe insert a:

    proc.stdout.readlines()

in there before the wait().

-- 
Michael Welsh Duggan
(address@hidden)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]