corrected issue when searches with "q" gets encoded twice #93
No reviewers
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#93
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "master"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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']), ':')
Apologies for the delayed merge, just now getting back to normal workflows. Merged and good to go. Thanks!
Thanks for the merge, this app is turning out to be really useful for my sites!