urllib.quote_plus()

urllib.quote_plus(s, safe='')[source]

Quote the query fragment of a URL; replacing ‘ ‘ with ‘+’