2015-04-02 59 views
-2

processCommit.py脚本的样子:FileNotFoundError:[WinError 2]蟒蛇3.4后提交钩

Error: post-commit hook failed (exit code 1) with output: 
Error: Traceback (most recent call last): 
Error: File "D:\Repositories\IapAdmin\hooks\processCommit.py", line 15, in <module> 
Error:  changed = subprocess.Popen(cmd,stdout=subprocess.PIPE).communicate()[0] 
Error: File "C:\Python34\lib\subprocess.py", line 859, in __init__ 
Error:  restore_signals, start_new_session) 
Error: File "C:\Python34\lib\subprocess.py", line 1112, in _execute_child 
Error:  startupinfo) 
Error: FileNotFoundError: [WinError 2] The system cannot find the file specified 
+0

的Python 3.5仍然只是一个alpha释放;你通过Python 3.4使用它的任何原因? – 2015-04-02 17:56:59

+0

看起来像你的'processCommit.py'文件有解析错误。我很确定错误信息正指向你的错误。您可能希望遵循Python教程来了解更多信息。 – DavidS 2015-04-02 17:58:31

+0

现在我指向python 3.4 – 2015-04-02 19:03:01

回答

1

添加周围[email protected]报价:

,我收到后提交

cmd = 'C:\Program Files\VisualSVN Server\bin\svnlook changed %s -r %s' % (repo, rev) 
Line 15 -->**changed = subprocess.Popen(cmd,stdout=subprocess.PIPE).communicate()[0]** 
cmd = 'C:\Program Files\VisualSVN Server\bin\svnlook info %s -r %s' % (repo, rev) 

错误

session.sendmail('[email protected]', '[email protected]', msg.as_string()) 

更新

cmd = 'C:\Program Files\VisualSVN Server\bin\svnlook changed %s -r %s' % (repo, rev) 
changed = subprocess.Popen(cmd, stdout=subprocess.PIPE).communicate()[0] # line 15 
cmd = 'C:\Program Files\VisualSVN Server\bin\svnlook info %s -r %s' % (repo, rev) 

代替使用\为路径,使用/

cmd = 'C:/Program Files/VisualSVN Server/bin/svnlook changed %s -r %s' % (repo, rev) 
+0

现在得到此错误 错误:追溯(m ost最近调用last): 错误:文件“D:\ Repositories \ IapAdmin \ hooks \ processCommit.py”,第15行,在 错误:changed = subprocess.Popen(cmd,stdout = subprocess.PIPE).communicate )[0] 错误:文件“C:\ Program Files \ Python 3.5 \ lib \ subprocess.py”,行855,在__init__中 错误:restore_signals,start_new_session) 错误:文件“C:\ Program Files \ Python 3.5 \ lib \ subprocess.py“,1123行,在_execute_child中 错误:startupinfo) 错误:FileNotFoundError:[WinError 2]系统找不到指定的文件 – 2015-04-02 17:59:27

+0

用代码抛出该问题, 15. – Celeo 2015-04-02 18:05:46

+0

cmd ='C:\ Program Files \ VisualSVN Server \ bin \ svnlook已更改%s -r%s'%(回购,rev)----第14行 changed = subprocess.Popen(cmd,stdout = subprocess.PIPE).communicate()[0] ----第15行 cmd ='C:\ Program Files \ VisualSVN Server \ bin \ svnlook info%s -r% s'%(repo,rev)------ line 16 – 2015-04-02 18:38:02