尝试使用 pysvn 进行 SVN 导出时如何解决此错误? [英] How do I solve this error while attempting an SVN export using pysvn?

查看:73
本文介绍了尝试使用 pysvn 进行 SVN 导出时如何解决此错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Python SVN 绑定 (pysvn) 在存储库上进行导出,但遇到以下错误:

I am attempting to use the Python SVN bindings (pysvn) to do an export on a repository and am encountering the following error:

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/ 没有问题.

However, doing a svn export --force https://svn.mycompany.com/myproject/trunk/ from a shell prompt works without issue.

我正在使用:

  • Python 2.7.3
  • 颠覆 1.7.5
  • CentOS 6.0 x64

有什么想法吗?

推荐答案

Subversion API 在内部使用规范 URL 和路径.您的 URL 有尾部斜杠,这不是规范 URL.在调用 Subversion API 函数之前删除尾部斜杠或使用 svn_uri_canonicalize() 函数规范化 URL.

Subversion API uses canonical URL and paths internally. You URL have trailing slash and this is not canonical URL. Remove trailing slash or use svn_uri_canonicalize() function to canonicalize URL before calling Subversion API functions.

您可以在 Subversion API 文档中找到更多详细信息:http://subversion.apache.org/docs/api/latest/svn_dirent_uri_8h.html

You can find more details in Subversion API documentation: http://subversion.apache.org/docs/api/latest/svn_dirent_uri_8h.html

这篇关于尝试使用 pysvn 进行 SVN 导出时如何解决此错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆