我想使用Python执行以下SVN命令:
svn log -v --xml --stop-on-copy --no-auth-cache --trust-server-cert --non-interactive --username <user> --password <password> <repo>
我试过这种方式:
cmd = 'svn log -v --xml --stop-on-copy --no-auth-cache --trust-server-cert --non-interactive --username <user> --password <password> <repo>'
args = shlex.split(cmd)
pro = subprocess.Popen(
args,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
output, err = pro.communicate()
如果我执行SVN,它会返回一个XML。 如果我执行Python,则输出和错误是空白的。
有什么想法吗?