[Python-Dev] urllib - {quote,unquote} vs. {quote_plus,unquote_plus}

Guido van Rossum guido@beopen.com
Sun, 30 Jul 2000 10:34:06 -0500

> I realize there is a symmetry between the functionality of
> urllib.{quote,unquote} and urllib.{quote_plus,unquote_plus}, but why doesn't
> unquote function like unquote_plus and map "+" to " "?

The +/space mapping is unique to CGI query strings.

The unquote function is used in a lot of places to decode parts of
URLs (e.g. throughout urllib.py itself), e.g. the hostname or (more
likely) the pathname can be encoded using %xx, and there a + does
*not* mean a space.

--Guido van Rossum (home page: http://www.pythonlabs.com/~guido/)