danielpronych / python-twitter

Automatically exported from code.google.com/p/python-twitter
Apache License 2.0
0 stars 0 forks source link

GetStatus('cfkarsten') TwitterError: id must be an long integer #109

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.   >>> statuses = api.GetUserTimeline(user)
 where "user" is either a Twitter "short name"...
2.
3.

What is the expected output? What do you see instead?
In [4]: api.GetStatus('cfkarsten')
---------------------------------------------------------------------------
TwitterError                              Traceback (most recent call last)

/home/juser/<ipython console> in <module>()

/usr/local/lib/python2.6/dist-packages/twitter.pyc in GetStatus(self, id)
   1480         long(id)
   1481     except:
-> 1482       raise TwitterError("id must be an long integer")
   1483     url = 'http://twitter.com/statuses/show/%s.json' % id
   1484     json = self._FetchUrl(url)

TwitterError: id must be an long integer

What version of the product are you using? On what operating system?
Revision:  8780372aff  

Please provide any additional information below.

Original issue reported on code.google.com by cfkars...@gmail.com on 4 Dec 2009 at 10:10

GoogleCodeExporter commented 8 years ago

Original comment by dclinton on 4 Dec 2009 at 10:33

GoogleCodeExporter commented 8 years ago
I'm confused so I'm going to ask what may be a silly question :)

In the code sample you have to reproduce the issue you show a GetUserTimeline() 
call
but below you show the example that triggers the exception as 
GetStatus('cfkarsten')

GetStatus() should only be called with a status id number and not a username/id 
- so
the exception is accurate.

Here is the python session I just did to show what I mean. If i've got it wrong
please reopen the issue.

>>> import twitter
>>> api = twitter.Api('foo', 'bar')
>>> api.GetStatus('cfkarsten')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "twitter.py", line 1482, in GetStatus
    raise TwitterError("id must be an long integer")
twitter.TwitterError: id must be an long integer
>>> api.GetUserTimeline('cfkarsten')
[<twitter.Status object at 0x76a950>, <twitter.Status object at 0x76a990>,
<twitter.Status object at 0x76a9d0>, <twitter.Status object at 0x76aa10>,
<twitter.Status object at 0x76aa50>, <twitter.Status object at 0x76aa90>,
<twitter.Status object at 0x76aad0>, <twitter.Status object at 0x76ab10>,
<twitter.Status object at 0x76ab50>, <twitter.Status object at 0x76ab90>,
<twitter.Status object at 0x76abd0>, <twitter.Status object at 0x76ac10>,
<twitter.Status object at 0x76ac50>, <twitter.Status object at 0x76ac90>,
<twitter.Status object at 0x76acd0>, <twitter.Status object at 0x76ad10>,
<twitter.Status object at 0x76ad50>, <twitter.Status object at 0x76ad90>,
<twitter.Status object at 0x76add0>, <twitter.Status object at 0x76ae10>]
>>> api.GetStatus(7434193696)
<twitter.Status object at 0x75ddd0>
>>> 

Original comment by bear42 on 9 Jan 2010 at 12:30

GoogleCodeExporter commented 8 years ago
Huh, yeah.. looks like I got confused. 

Original comment by cfkars...@gmail.com on 9 Jan 2010 at 4:04

GoogleCodeExporter commented 8 years ago
no worries :)

I'm trying to chew thru a couple issues every week to catch up on the backlog 
as I get 
free time.

thanks

Original comment by bear42 on 9 Jan 2010 at 4:20

GoogleCodeExporter commented 8 years ago
I have same problem.
when i am using api.GetStatus('myusername')
console says: 

File "/usr/lib/python2.6/site-packages/twitter.py", line 1434, in GetStatus
    raise TwitterError("id must be an long integer")
twitter.TwitterError: id must be an long integer

OS: Fedora 13
I am using latest version of python-twitter.

Original comment by zviad.ki...@gmail.com on 10 Jul 2010 at 9:06