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

Re: Subversion portability

From: Bruce Atherton <bruce_at_callenish.com>
Date: 2002-02-12 21:16:57 CET

At 06:44 PM 2/11/2002 +0000, Philip Martin wrote:
>Ben Collins-Sussman <sussman@collab.net> writes:
> > Branko Œibej <brane@xbc.nu> writes:
> >
> > > os.path.join() on windows never gives you a valid URL. *bonk*!
> >
>Greg Stein suggested urlparse.urljoin
>but it didn't work for me
>since file:///xxx gets converted to file:/xxx

Same for me on Windows using Activestate Python 2.1.1.

This should be easy to work around, though, if in a grotesque way:

# FIXME: On at least some versions of Python, a bug in urlparse.urljoin()
# strips required slashes out of a "file:" URL. This repairs the damage.
# Once Python is fixed to get it right, the required Python version
# should be upped and this code should be stripped.
import re

find_bad_url = re.compile("file:/[^/]")
if (find_bad_url.match(urlstring)) is not None:
     urlstring = urlstring[0:5] + "//" + urlstring[5:]

To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:07 2006

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.