Skip to content
Myr

Simplify requote_path.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

It no longer needs to split on '/' since '/' will not be encoded.

authored by Matt Giuca · committed by Matt Giuca · parent fcac1c3 · Browse files · 1 file+1 added−3 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−3 removed

  • other:+1 added−3 removed

1 file+1 added−3 removed

modified:requests/utils.py+1 added-3 removed
423 unmodified lines
424425 This function passes the given path through an unquote/quote cycle to426 ensure that it is fully and consistently quoted.427 """428 parts = path.split("/")428 # Unquote only the unreserved characters429 # Then quote only illegal characters (do not quote reserved, unreserved,430 # or '%')432 parts = (quote(unquote_unreserved(part), safe="!#$%&'()*+,/:;=?@[]~")433 for part in parts)431 return quote(unquote_unreserved(path), safe="!#$%&'()*+,/:;=?@[]~")432 return "/".join(parts)