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

Python's urlparse.urljoin() (was: Re: Subversion portability)

From: Greg Stein <gstein_at_lyra.org>
Date: 2002-02-12 21:35:34 CET

If anybody can come up with a patch for urlparse.py, then I can check it
into Python itself :-)

(of course, given that Python 2.2 was just released, I don't expect 2.3 to
come out for a long while...)

Cheers,
-g

On Tue, Feb 12, 2002 at 12:16:57PM -0800, Bruce Atherton wrote:
> At 06:44 PM 2/11/2002 +0000, Philip Martin wrote:
>...
> >Greg Stein suggested urlparse.urljoin
> >
> >http://subversion.tigris.org/servlets/ReadMsg?msgId=53677&listName=dev
> >
> >but it didn't work for me
> >
> >http://subversion.tigris.org/servlets/ReadMsg?msgId=53693&listName=dev
> >
> >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:]

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
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.