How to solve this error when trying to export SVN using pysvn?

I am trying to use Python SVN bindings (pysvn) to export to a repository and I find 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) 

Code example:

 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) 

However, running svn export --force https://svn.mycompany.com/myproject/trunk/ from the shell works without problems.

I use:

  • Python 2.7.3
  • Subversion 1.7.5
  • CentOS 6.0 x64

Any ideas please?

+4
source share
2 answers

The Subversion API uses canonical URLs and paths internally. Your URL has a trailing slash, and this is not a canonical URL. Remove the trailing slash or use the svn_uri_canonicalize () function to canonicalize the URL before calling the Subversion API functions.

See the Subversion API documentation for more details: http://subversion.apache.org/docs/api/latest/svn_dirent_uri_8h.html

+3
source

I tried using the svn+ssh:// scheme and got the same error. This led me to believe that the assertion error could not actually be related to the repo URI. On a whim, I changed the export directory to /tmp/ , and everything worked fine. The directory that I tried to use earlier ( ./temp ) exists in my home directory, which is on an NFS mount with the "root squash" option turned on. It is known that this caused problems with the odd application.

+1
source

All Articles