Re: Splitting URLs

2007-10-22 Thread Paul Boddie
On 22 Okt, 03:53, Tim Chase <[EMAIL PROTECTED]> wrote: > > This seems to be intentional, rather than a bug. In my > python2.4/urlparse.py file, there's a uses_netloc list which > clearly does not have 'mailto' in it. I can't give an > explanation/justification for it, but it seems to me (IMHO) th

Re: Splitting URLs

2007-10-21 Thread Tim Chase
>> there are some goodies in urllib for doing some of this splitting. >> Example code at the bottom of my reply (though it seems to choke on >> certain protocols such as "mailto:"; and "ssh:" because urlparse doesn't >> return the netloc properly) > > It doesn't? That's... bad. But for my applica

Re: Splitting URLs

2007-10-21 Thread Steven D'Aprano
On Sun, 21 Oct 2007 14:55:01 -0500, Tim Chase wrote: > there are some goodies in urllib for doing some of this splitting. > Example code at the bottom of my reply (though it seems to choke on > certain protocols such as "mailto:"; and "ssh:" because urlparse doesn't > return the netloc properly)

Re: Splitting URLs

2007-10-21 Thread Tim Chase
> URL = 'http://steve:[EMAIL PROTECTED]:82/dir" + \ > 'ectory/file.html;params?query#fragment' > > If I split the URL, I would like to get the following components: > > scheme = 'http' > netloc = 'steve:[EMAIL PROTECTED]:82' > username = 'steve' > password = 'secret' > hostname = 'www.domain.

Splitting URLs

2007-10-21 Thread Steven D'Aprano
I'm trying to split a URL into components. For example: URL = 'http://steve:[EMAIL PROTECTED]:82/dir" + \ 'ectory/file.html;params?query#fragment' (joining the strings above with plus has no significance, it's just to avoid word-wrapping) If I split the URL, I would like to get the followi