4

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)

The example code is:

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, doing a svn export --force https://svn.mycompany.com/myproject/trunk/ from a shell prompt works without issue.

I'm using:

  • Python 2.7.3
  • Subversion 1.7.5
  • CentOS 6.0 x64

Any ideas, please?

jamieb
  • 9,847
  • 14
  • 48
  • 63
  • What if you try with absolute path instead of ./temp? subversion/libsvn_subr/dirent_uri.c:955 line is assert(svn_dirent_is_canonical(base, pool)); so the problem is with path format – Dmitry Pavlenko Jul 24 '12 at 09:08

2 Answers2

3

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.

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

Ivan Zhakov
  • 3,981
  • 28
  • 24
  • Thanks for the great hint! In my case I had used `--config-dir` option with a path that ended with a slash, and that slash caused the assertion failure. – oliver Aug 08 '17 at 11:40
1

I tried using the svn+ssh:// scheme and got the same error. This lead me to believe that the assertion failure might not actually be related to the repo URI. On a whim, I changed the export directory to /tmp/ and everything worked fine. The directory I was trying to use previously (./temp) exists in my home directory which is on an NFS mount with the "root squash" option enabled. This has been known to cause odd application issues before.

jamieb
  • 9,847
  • 14
  • 48
  • 63