summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaleb Brown <git@calebbrown.id.au>2012-04-19 13:07:05 +1000
committerCaleb Brown <git@calebbrown.id.au>2012-04-19 13:07:05 +1000
commitb373b48ab363fea2195d00f4e2a91cc77315f2a0 (patch)
treed78f659894c6f1b655788d4a5a68b573e4a05589
parenta0f10d6455ee285d713dee34e99131cdc6ab0b95 (diff)
downloadoauthlib-b373b48ab363fea2195d00f4e2a91cc77315f2a0.tar.gz
Add comment indicating why we need "safe='~'" in the call to urllib.quote.
-rw-r--r--oauthlib/oauth1/rfc5849/utils.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/oauthlib/oauth1/rfc5849/utils.py b/oauthlib/oauth1/rfc5849/utils.py
index 786fa2e..6737e90 100644
--- a/oauthlib/oauth1/rfc5849/utils.py
+++ b/oauthlib/oauth1/rfc5849/utils.py
@@ -98,6 +98,8 @@ def escape(u):
"""
if not isinstance(u, unicode):
raise ValueError('Only unicode objects are escapable.')
+ # Letters, digits, and the characters '_.-' are already treated as safe
+ # by urllib.quote(). We need to add '~' to fully support rfc5849.
return urllib.quote(u.encode('utf-8'), safe='~')