The popen libraries don't seem to function properly when used from a Zope External Method or product. I use the standard idiom -- i, o = os.popen2( cmd ) i.close() res = o.read()
but Zope seems to hangs on the read whenever cmd is anything of any complexity, for example, a shell script that fires off a python instance that detaches itself and then initiates another insance of Zope. Is the problem a threading issue? Is there a preferred mechanism for spawning a process?
Dennis Allison wrote at 2004-1-31 10:06 -0800:
The popen libraries don't seem to function properly when used from a Zope External Method or product. I use the standard idiom -- i, o = os.popen2( cmd ) i.close() res = o.read()
but Zope seems to hangs on the read whenever cmd is anything of any complexity, for example, a shell script that fires off a python instance that detaches itself and then initiates another insance of Zope. Is the problem a threading issue?
Probably not:
I used "ZCVSFolder" which uses "popenX" and did not have problems.
Almost surely, your "cmd" buffers its output and does not make a "flush".