2012-07-24 112 views
4

我试图使用Python SVN绑定(pysvn)做一个仓库的出口,我遇到了以下错误:如何在使用pysvn尝试SVN导出时解决此错误?

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的

任何想法,请?

+0

如果你尝试用绝对路径,而不是./temp什么? subversion/libsvn_subr/dirent_uri.c:955行是assert(svn_dirent_is_canonical(base,pool));所以问题是与路径格式 – 2012-07-24 09:08:39

回答

1

我尝试使用svn+ssh://方案并得到相同的错误。这使我相信断言失败实际上可能与repo URI没有关系。一时兴起,我将出口目录改为/tmp/,一切正常。我之前尝试使用的目录(./temp)存在于我的主目录中,该主目录在启用了“root squash”选项的NFS安装目录中。这已知会导致以前的奇怪应用程序问题。

3

Subversion API在内部使用规范的URL和路径。您的网址有斜线,这不是规范的URL。在调用Subversion API函数之前,除去尾部斜线或使用svn_uri_canonicalize()函数对URL进行规范化。

你可以找到Subversion的API文档中更多的细节: http://subversion.apache.org/docs/api/latest/svn_dirent_uri_8h.html

+0

感谢您的伟大提示!在我的情况下,我使用了'--config-dir'选项,以斜线结尾的路径,并且该斜线导致断言失败。 – oliver 2017-08-08 11:40:27

相关问题