cannot urllib.urlencode a URL in python
That's not what that function does:
urlencode(query, doseq=0)
Encode a sequence of two-element tuples or dictionary into a URL query string.
Are you looking for?
-
urllib.quote(callback)
Python 2 -
urllib.parse.quote(callback)
Python 3
Python is not PHP. You want urllib.quote()
instead.