1
我需要在Windows 7 x64(使用cwRsync 5.5.0)從Python 2.7應用程序運行rsync。從窗口中的python子進程運行rsync
一切正常,從命令行:在ENV 集CWRSYNCHOME到cwrsync二進制文件,並運行以下命令
rsync.exe "/cygdrive/e/test" [email protected]:
但試圖運行相同的命令蟒子時:
process = subprocess.Popen(['rsync.exe', '/cygdrive/e/test', '[email protected]:'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
shell=True,
env={'CWRSYNCHOME': './bin'})
stdout, stderr = process.communicate()
print 'STDOUT:{}\nSTDERR:{}'.format(stdout, stderr)
我得到stderr中出現以下錯誤:
rsync: pipe: Operation not permitted (1)
rsync error: error in IPC code (code 14) at pipe.c(59) [sender=3.1.2]
Here是冗長的rsync標準輸出:
FILE_STRUCT_LEN=16, EXTRA_LEN=4
cmd=<NULL> machine=192.168.1.14 user=test1 path=.
cmd[0]=ssh cmd[1]=-l cmd[2]=test1 cmd[3]=192.168.1.14 cmd[4]=rsync cmd[5]=--server cmd[6]=-vvvvve.LsfxC cmd[7]=. cmd[8]=.
opening connection using: ssh -l test1 192.168.1.14 rsync --server -vvvvve.LsfxC . . (9 args)
[sender] _exit_cleanup(code=14, file=pipe.c, line=59): entered
[sender] _exit_cleanup(code=14, file=pipe.c, line=59): about to call exit(14)
Tryed集外殼=假,並通過命令作爲單條線(未CMD和args) - 錯誤STIL重複。
我在做什麼錯了?