unquote_unreserved() — requests Function Reference
Architecture documentation for the unquote_unreserved() function in utils.py from the requests codebase.
Entity Profile
Dependency Diagram
graph TD 3ee84e71_4831_1957_cb26_fb2c39d96fe3["unquote_unreserved()"] 2c39b9da_e317_5e6c_bbac_8362bac2110c["utils.py"] 3ee84e71_4831_1957_cb26_fb2c39d96fe3 -->|defined in| 2c39b9da_e317_5e6c_bbac_8362bac2110c f46aaada_a38d_85e6_6125_21764bf29eda["requote_uri()"] f46aaada_a38d_85e6_6125_21764bf29eda -->|calls| 3ee84e71_4831_1957_cb26_fb2c39d96fe3 style 3ee84e71_4831_1957_cb26_fb2c39d96fe3 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
src/requests/utils.py lines 624–645
def unquote_unreserved(uri):
"""Un-escape any percent-escape sequences in a URI that are unreserved
characters. This leaves all reserved, illegal and non-ASCII bytes encoded.
:rtype: str
"""
parts = uri.split("%")
for i in range(1, len(parts)):
h = parts[i][0:2]
if len(h) == 2 and h.isalnum():
try:
c = chr(int(h, 16))
except ValueError:
raise InvalidURL(f"Invalid percent-escape sequence: '{h}'")
if c in UNRESERVED_SET:
parts[i] = c + parts[i][2:]
else:
parts[i] = f"%{parts[i]}"
else:
parts[i] = f"%{parts[i]}"
return "".join(parts)
Domain
Subdomains
Defined In
Called By
Source
Frequently Asked Questions
What does unquote_unreserved() do?
unquote_unreserved() is a function in the requests codebase, defined in src/requests/utils.py.
Where is unquote_unreserved() defined?
unquote_unreserved() is defined in src/requests/utils.py at line 624.
What calls unquote_unreserved()?
unquote_unreserved() is called by 1 function(s): requote_uri.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free