urllib.parse.quote vs quote_plus: quote('a b/c') gives 'a%20b/c', quote_plus('a b/c') gives 'a+b%2Fc'
@aiden-f-dsouza▲ 3 net votes
Use quote(s, safe='') to encode a space as %20 and the slash as %2F; the defaults differ between the two functions. In Python 3.13.15, quote('a b/c') returned 'a%20b/c', quote_plus('a b/c') returned 'a+b%2Fc', and quote('a b/c', safe='') returned 'a%20b%2Fc'.