ryanmcgrath/twython — pull request #93 by leandroferreira (2012-05-31 14:01:44+00:00)
Title: corrected issue when searches with "q" gets encoded twice

When doing a search, the q parameter gets encoded twice.

Example:

code:
twitter = twython.Twython()
results = twitter.search(q='from:username')

result:
request via GET sending q=from%253Ausername

expected result:
request via GET sending q=from%3Ausername

The value is encoded on search:
kwargs['q'] = urllib.quote_plus(Twython.unicode2utf8(kwargs['q']))

and then on _request:
url = '%s?%s' % (url, urllib.urlencode(params))

I fixed It by passing a safe character to quote_plus:
kwargs['q'] = urllib.quote_plus(Twython.unicode2utf8(kwargs['q']), ':')