popen4 hangs when calling rsync
bnelson at appservers.us
Fri Apr 11 01:20:41 CEST 2003
I'm having problems when using popen from within threads. The problem
only appears when I'm calling rsync. It seems the process never exits.
It runs fine when run from the main thread of the application.
The code is as follows....
SYNC_CMD = "/usr/bin/rsync -rlptDvz --no-detach --progress
--stats --delete --delete-after --delete-excluded --timeout=180
rsync://mirror.appservers.us/appserver /usr/portage "
def _runCmdAndLogPopen4(self, cmd):
re, w = popen2.popen4(cmd)
logger.info("read next line")
char = re.readline()
if not char: break
logger.info("after command executed")
Is this a general problem with using popen from within threads? Or is it
something to do with rsync.
Thanks for your help!
More information about the Python-list