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

Re: [PATCH] to help benchmark.py run on windows

From: Neels Hofmeyr <neels_at_elego.de>
Date: Tue, 19 Apr 2011 18:28:09 +0200

On Tue, 2011-04-19 at 17:07 +0200, Stephen Butler wrote:
> On Apr 19, 2011, at 15:32 , Neels Hofmeyr wrote:
>
> >>>>
> >>>> This attached patch fixes three issues with the script:
> >>>> 1) use of file:// when I'm sure that file:/// is correct from previous discussions on this list
> >
> > This particular change is not necessary -- code extract with
> > annotations:
> >
> > base = tempfile.mkdtemp() # base == '/tmp/dir123'
> > repos = j(base, 'repos') # repos == '/tmp/dir123/repos'
> > file_url = 'file://%s' % repos # file_url == 'file://' + '/tmp/...'
> >
> > With your change, file_url becomes file:////tmp/..., which is still
> > valid, but nonsense :) (BTW, the script would not have worked if there
> > had been only two slashes.)
>
> On Windows, the path returned by mkdtemp() is something like
>
> C:\users\billga~1\appdata\local\temp\tmpfoobar
>
> with no leading slash, so an extra slash makes the URL valid.

gotcha!
Thanks, Steve, I wasn't aware of that. Sorry, Alan, I am hopelessly
unix. Let me paraphrase. Hopefully unix.

So we need a special treatment. Like

  file_url = 'file://'
  if not base.startswith('/'):
    file_url.append('/')

...or leave the four slashes, that's also fine, actually.

~Neels
Received on 2011-04-19 18:29:00 CEST

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.