我正在尝试使用 Python SVN 绑定(bind) (pysvn) 在存储库上进行导出,但遇到以下错误:
python: subversion/libsvn_subr/dirent_uri.c:955: svn_dirent_join: Assertion `svn_dirent_is_canonical(base, pool)' failed.
Aborted (core dumped)
示例代码是:
import pysvn
client = pysvn.Client()
uri = 'https://svn.mycompany.com/myproject/trunk/'
# This works fine
print client.list(uri)
# This crashes with the above error
r = client.export(uri, './temp', force=True)
但是,从 shell 提示执行 svn export --force https://svn.mycompany.com/myproject/trunk/
没有问题。
我正在使用:
- python 2.7.3
- 颠覆 1.7.5
- CentOS 6.0 x64
有什么想法吗?
最佳答案
Subversion API 在内部使用规范的 URL 和路径。您的 URL 有尾部斜杠,这不是规范 URL。在调用 Subversion API 函数之前删除尾部斜杠或使用 svn_uri_canonicalize() 函数规范化 URL。
您可以在 Subversion API 文档中找到更多详细信息: http://subversion.apache.org/docs/api/latest/svn_dirent_uri_8h.html
关于python - 尝试使用 pysvn 导出 SVN 时如何解决此错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11624395/