AttributeError: 'Twython' object has no attribute 'auth' #90

Closed
opened 2012-05-17 09:09:02 -07:00 by tdedecko · 3 comments
tdedecko commented 2012-05-17 09:09:02 -07:00 (Migrated from github.com)

Example from the readme file fails because of undefined auth attribute.

In [1]: from twython import Twython

In [2]: twitter = Twython()

In [3]: results = twitter.search(q="beart")

AttributeError Traceback (most recent call last)
C:\projects\tweetair\tweetair in ()
----> 1 results = twitter.search(q="beart")

C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in search(self, *_kwargs)
433 kwargs['q'] = urllib.quote_plus(Twython.unicode2utf8(kwargs['q']))
434
--> 435 return self.get('https://search.twitter.com/search.json', params=kwargs)
436
437 def searchGen(self, search_query, *_kwargs):

C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in get(self, endpoint, params, version)
264 def get(self, endpoint, params=None, version=1):
265 params = params or {}
--> 266 return self.request(endpoint, params=params, version=version)
267
268 def post(self, endpoint, params=None, version=1):

C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in request(self, endpoint, method, params, version)
258 url = '%s/%s.json' % (self.api_url % version, endpoint)
259
--> 260 content = self._request(url, method=method, params=params, api_call=url)
261
262 return content

C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in _request(self, url, method, params, api_call)
203
204 func = getattr(self.client, method)
--> 205 response = func(url, data=myargs, auth=self.auth)
206 content = response.content.decode('utf-8')
207

AttributeError: 'Twython' object has no attribute 'auth'

Example from the readme file fails because of undefined auth attribute. In [1]: from twython import Twython In [2]: twitter = Twython() ## In [3]: results = twitter.search(q="beart") AttributeError Traceback (most recent call last) C:\projects\tweetair\tweetair<ipython-input-3-2d74fd63d882> in <module>() ----> 1 results = twitter.search(q="beart") C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in search(self, *_kwargs) 433 kwargs['q'] = urllib.quote_plus(Twython.unicode2utf8(kwargs['q'])) 434 --> 435 return self.get('https://search.twitter.com/search.json', params=kwargs) 436 437 def searchGen(self, search_query, *_kwargs): C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in get(self, endpoint, params, version) 264 def get(self, endpoint, params=None, version=1): 265 params = params or {} --> 266 return self.request(endpoint, params=params, version=version) 267 268 def post(self, endpoint, params=None, version=1): C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in request(self, endpoint, method, params, version) 258 url = '%s/%s.json' % (self.api_url % version, endpoint) 259 --> 260 content = self._request(url, method=method, params=params, api_call=url) 261 262 return content C:\projects\tweetair\tweetair\lib\site-packages\twython\twython.pyc in _request(self, url, method, params, api_call) 203 204 func = getattr(self.client, method) --> 205 response = func(url, data=myargs, auth=self.auth) 206 content = response.content.decode('utf-8') 207 AttributeError: 'Twython' object has no attribute 'auth'
michaelhelmick commented 2012-05-17 09:21:07 -07:00 (Migrated from github.com)

@tdedecko Thanks for pointing this out. I'll add a fix to in my soon-Pull Request (https://github.com/michaelhelmick/twython/tree/requests_image_posting)

@tdedecko Thanks for pointing this out. I'll add a fix to in my soon-Pull Request (https://github.com/michaelhelmick/twython/tree/requests_image_posting)
michaelhelmick commented 2012-05-17 09:27:22 -07:00 (Migrated from github.com)

@tdedecko Terribly sorry about that, forgive me? ❤️

@tdedecko Terribly sorry about that, forgive me? :heart:
tdedecko commented 2012-05-17 09:33:28 -07:00 (Migrated from github.com)

No worries. Just slowed me down for a bit trying to figure out if I did something wrong. I fixed it for my own uses. Thanks for the quick response!

No worries. Just slowed me down for a bit trying to figure out if I did something wrong. I fixed it for my own uses. Thanks for the quick response!
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: code/twython#90
No description provided.