tweepy/tweepy — Issue #134: Stream failed if using oauth authentication if track keyword has space character
Author: terrybleger
Created: 2011-11-09 11:45:45+00:00
State: open

So many people thought it was the urllib or httplib fault, but twitter always response 401 Unauthorized.

'i have space character'
'i+have+space+character'
'i%20have%20space%20character'

It's a total useless to escape or even unescape since it was not the urllib problem.

"" total fail if there is any space character inside track ""
auth = tweepy.auth.OAuthHandler('consumer_key', 'consumer_secret')
auth.set_access_token('oauth_token', 'oauth_secret')

"" works like a charm but twitter said they will eradicate this using ""
auth = tweepy.auth.BasicAuthHandler('my_user', 'my_pass')

stream = Stream(auth, StreamListener())
stream.filter(follow=None, track='i have space character', async=False, locations=None, count=None)