[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Fix Windows test failures - Python test suite bug in quoting a trailing backslash

From: Julian Foad <julian.foad_at_wandisco.com>
Date: Tue, 09 Nov 2010 12:07:16 +0000

On Tue, 2010-11-09, Philip Martin wrote:
> Paul Burba <ptburba_at_gmail.com> writes:
> > File "C:\SVN\src-trunk-2\subversion\tests\cmdline\svntest\main.py",
> > line 433, in spawn_process
> > subprocess.list2cmdline(varargs)))
> > File "C:\Python26\lib\subprocess.py", line 541, in list2cmdline
> > needquote = (" " in arg) or ("\t" in arg) or ("|" in arg) or not arg
> > TypeError: argument of type 'int' is not iterable
> > FAIL: commit_tests.py 41: set revision props during remote mkdir
> > ]]]
> >
> > No time to look into this further today, but I can check it out tomorrow.
> Mapping to strings looks like it should fix that:
> subprocess.list2cmdline(map(str varargs))))

Thanks: I forgot to run the full test suite. (With a comma: map(str,

But I realized list2cmdline() is Windows-specific, so although we're
only using it for display purposes it's not nice for us Unix types. (We
like to be able to copy and paste and run the displayed command.)

I have searched the web for a generic way of doing this, and found
references to several methods including subprocess.list2cmdline(),
pipes.quote(), commands.mkarg(), and various code snippets. None of
these are good generic solutions. I saw recent discussions on a Python
mailing list about the need for a generic solution.

So here is another patch, doing the best I can for now. I'm still
testing this one.

- Julian

Received on 2010-11-09 13:07:59 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.