Package: python-svn
Version: 1.5.1-2
Severity: normal

The script below sets up a test repository, and then generates this output:

file:///tmp/pysvn-bug/test_repos/trunk/testing/file with spaces
[('file with spaces', <PysvnInfo ''>)]
file:///tmp/pysvn-bug/test_repos/trunk/testing/file%20with%20twenties
Traceback (most recent call last):
  File "<string>", line 1, in ?
pysvn._pysvn_2_4.ClientError: URL 
'file:///tmp/pysvn-bug/test_repos/trunk/testing/file%20with%20twenties' 
non-existent in revision '4'

I don't know what layer contains the bug, but I would suggest that
it's a reasonable invariant to be able to say that pysvn.Client.info2
can be called on any .path returned by pysvn.Client.list, especially
if the repository hasn't changed in the meantime.

I'll note that if I manually feed that url to the svn commandline, it
fails, but in an entirely different way:
  $ svn info 
file:///tmp/pysvn-bug/test_repos/trunk/testing/file%20with%20twenties
  file:///tmp/pysvn-bug/test_repos/trunk/testing/file%20with%20twenties:  (Not 
a valid URL)

if I manually quote those, I get:

  $ svn info 
file:///tmp/pysvn-bug/test_repos/trunk/testing/file%2520with%2520twenties
  Path: file%20with%20twenties
  Name: file%20with%20twenties
  URL: file:///tmp/pysvn-bug/test_repos/trunk/testing/file%2520with%2520twenties

and likewise, that works in info2 as well:
  >>> 
pysvn.Client().info2("file:///tmp/pysvn-bug/test_repos/trunk/testing/file%2520with%2520twenties")
  [('file%20with%20twenties', <PysvnInfo ''>)]

but if my code is supposed to know about and perform that quoting, it
really needs to be documented as part of pysvn (obviously I'd prefer
it to be fixed, instead, at whatever level is suitable.)

Also, that %20 case isn't hypothetical - it involves checking in web
content which actually has quoting like that - I've just cooked the
example down a bit.

#!/bin/sh -ex

rm -rf test_repos
rm -rf test_svn_checkout

case "$1" in
  clean) exit 0;
  ;;
esac

SVN=file://$(pwd)/test_repos

# create the repository 
  svnadmin create test_repos
  svn mkdir  -m $LINENO $SVN/trunk
  svn mkdir  -m $LINENO $SVN/trunk/testing
# create a file with a space
  svn co $SVN/trunk/testing test_svn_checkout
  touch "test_svn_checkout/file with spaces"
  svn add "test_svn_checkout/file with spaces"
  svn commit -m $LINENO "test_svn_checkout/file with spaces"
  touch "test_svn_checkout/file%20with%20twenties"
  svn add "test_svn_checkout/file%20with%20twenties"
  svn commit -m $LINENO "test_svn_checkout/file%20with%20twenties"
  python -c 'import pysvn; pc=pysvn.Client(); 
pl=pc.list("'$SVN'/trunk/testing",recurse=True); print pl[1][0].path; print 
pc.info2(pl[1][0].path); print pl[2][0].path; print pc.info2(pl[2][0].path)'


-- System Information:
Debian Release: lenny/sid
  APT prefers testing
  APT policy: (500, 'testing'), (500, 'stable')
Architecture: i386 (x86_64)

Kernel: Linux 2.6.22-3-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/bash

Versions of packages python-svn depends on:
ii  libapr1                     1.2.11-1     The Apache Portable Runtime Librar
ii  libc6                       2.7-5        GNU C Library: Shared libraries
ii  libgcc1                     1:4.2.2-4    GCC support library
ii  libstdc++6                  4.2.2-4      The GNU Standard C++ Library v3
ii  libsvn1                     1.4.4dfsg1-1 Shared libraries used by Subversio
ii  libuuid1                    1.40.3-1     universally unique id library
ii  python                      2.4.4-6      An interactive high-level object-o
ii  python-central              0.5.15-0.1   register and build utility for Pyt

python-svn recommends no packages.

-- no debconf information



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to