这是我的代码,
import pysvn
def get_login( realm, username, may_save ):
print(username)
print(password)
return True, username, password, False
client = pysvn.Client()
username="abcd"
password="xyz"
client.set_default_username( username )
client.set_default_password( password )
client.callback_get_login = get_login
#check out the current version of the pysvn project
client.checkout('http://svn.source.com/svn/module', 'D:\pysvn')
我运行此代码时会抛出此错误
追踪(最近一次通话): 文件“123.py”,第13行,in client.checkout('http://svn.source.com/svn/module','D:\ pysvn') pysvn._pysvn_3_5.ClientError:无法连接到URL“http://svn.source.com/svn/module”的存储库 访问'/ svn / module'禁止
我尝试使用和不使用set_default_username和密码。 他们两个都给出了同样的错误。 实际上为什么会出现这个错误。这里的任何一位pySVN专家都可以解释一下吗?
答案 0 :(得分:1)
只是尝试不使用get_login并仅使用:
client.set_default_username( username )
client.set_default_password( password )
它对我有用。希望它有所帮助!