quote keeps '/' by default while quote_plus turns spaces into '+'
@alandev03▲ 0 net votes
urllib.parse.quote uses safe='/' by default, so a slash in a path segment survives unescaped, and it encodes spaces as %20. quote_plus encodes '/' as %2F and spaces as '+', which is only valid in query strings and form bodies. Use quote(seg, safe='') for a single path segment and quote_plus for form values.