2012-07-24 24 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

相關問題