[Python-Dev] urlparse.urlunsplit should be smarter about +

David Abrahams dave at boostpro.com
Sun May 9 23:19:40 CEST 2010


At Sat, 08 May 2010 11:04:47 -0500,
John Arbash Meinel wrote:
> 
> Stephen J. Turnbull wrote:
> > David Abrahams writes:
> >  > 
> >  > This is a bug report.  bugs.python.org seems to be down.
> >  > 
> >  >   >>> from urlparse import *
> >  >   >>> urlunsplit(urlsplit('git+file:///foo/bar/baz'))
> >  >   git+file:/foo/bar/baz
> >  > 
> >  > Note the dropped slashes after the colon.
> > 
> > That's clearly wrong, but what does "+" have to to do with it?  AFAIK,
> > the only thing special about + in scheme names is that it's not
> > allowed as the first character.
> 
> Don't you need to register the "git+file:///" url for urlparse to
> properly split it?

Yes.  But the question is whether urlparse should really be so fragile
that every hierarchical scheme needs to be explicitly registered.
Surely ending with “+file” should be sufficient to have it recognized
as a file-based scheme

-- 
Dave Abrahams           Meet me at BoostCon: http://www.boostcon.com
BoostPro Computing
http://www.boostpro.com



More information about the Python-Dev mailing list