ganesansays / python-twitter

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

NewFromJsonDict AttributeError #244

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Call GetUserTimeLine

What is the expected output? What do you see instead?

I have a 'twitter panel' on a site that uses python-twitter to get tweets. Most 
of the time it works fine but it's crashing every so often with the error shown 
below.

  File "/------/venv/lib/python2.7/site-packages/twitter.py", line 2682, in GetUserTimeline
    return [Status.NewFromJsonDict(x) for x in data]

  File "/------/venv/lib/python2.7/site-packages/twitter.py", line 620, in NewFromJsonDict
    return Status(created_at=data.get('created_at', None),

AttributeError: 'unicode' object has no attribute 'get'

What version of the product are you using? On what operating system?
0.8.2

Please provide any additional information below.

I cant reproduce this error by calling GetUserTimeline in a python shell. Seems 
like it only happens every so often (maybe depending on what the twitter api 
returns?)

Original issue reported on code.google.com by Mr.Matt....@gmail.com on 16 Nov 2012 at 10:07

GoogleCodeExporter commented 9 years ago
We got basically the same today, loads of 500 errors emailed to us, had to turn 
off the twitter block on the site:

File "----/site-packages/twitter.py", line 620, in NewFromJsonDict
    return Status(created_at=data.get('created_at', None),

AttributeError: 'str' object has no attribute 'get'.

Also using Version 0.8.2 on CentOS.

I've not had time to investigate further but my initial feeling is that twitter 
returned unexpected results that were then cached and kept causing this error.

Original comment by a...@altcom.co.uk on 31 Jan 2013 at 4:09

GoogleCodeExporter commented 9 years ago
as far as I know this is no longer an issue with v1.1

Original comment by bear42 on 6 Oct 2013 at 10:23