[Zope-Coders] Sovled: [Zope] popen hangs on W2K
Thomas Guettler
zopestoller@thomas-guettler.de
Thu, 14 Mar 2002 17:31:13 +0100
Chris Withers wrote:
>Hi Thomas,
>
>Thomas Guettler wrote:
>
>>Thomas Guettler wrote:
>>
>> > popen3() of the python (2.1.2) which comes with zope hangs on W2K:
>> >
>> > (stdin, stdout, stderr)=popen3('wvWare -x wvware.xml foo.doc')
>> > text=stdout.read()
>>
>
>So what did you change this code to in the end?
>
I ignore it now:
popen("wvware -x wvware.xml foo.doc 2> NUL")
A redirect to a file should work, without a race condition (dead lock), too.
I mailed python-docs@python.org that it would be nice to have a hint to
the possible
dead lock in the documentation of popen3. But received no response up to
now.
You could solve it with threads, too. Start two threads: one reading
stdout, one stderr and wait
until both have finished the read-statement.
thomas