Reputation: 49597
I am trying to use urllib.quote
on DOT character (.)
in python but am not getting my desired outptut.
>>> urllib.quote(".")
'.'
>>> urllib.quote_plus(".")
'.'
but when I unquote %2E
using urllib.unquote
I get
>>> urllib.unquote("%2E")
'.'
So, my question is why am I not able to get %2E
as my output when I use quote or quote_plus
on .
Upvotes: 1
Views: 3566
Reputation: 709
The link for Reference is http://docs.python.org/library/urllib.html '_.-' doesn't require a quote.
Upvotes: 2
Reputation: 318778
Dots do not need to be escaped. However, unquote
converts all %xx
characters since it is perfectly valid to encode any character, no matter if necessary or not.
Upvotes: 3