url parsing on in-house schemes
Alex Martelli
aleax at aleax.it
Fri Sep 21 04:10:34 EDT 2001
"rw2" <richw at objenv.com> wrote in message
news:20010920.153720.213975407.3413 at objenv.com...
> I followed the general convention of scheme://host/path in creation
> of new schemes, but neither urlparse nor urllib want to parse our new
> creations. This is understandable as the RFC says that everything after
> the colon is scheme dependent, but I'd like to know if there's a way to
> coax either of them to use scheme://host/path as a default instead of
> throwing an exception (urllib) or putting the host in the path (urlparse)
Sure:
import urlparse
urlparse.uses_netloc.insert('scheme')
should do exactly what you're asking.
Alex
More information about the Python-list
mailing list