pyfoo / python-twitter

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

simplejson decoder- No JSON object could be decoded #83

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Q-What steps will reproduce the problem?
A-trying to run this:
import twitter
api = twitter.Api()
statuses = api.GetPublicTimeline()

for s in statuses:
    date_ts = "|".join(s.created_at.split()[:4])
print "%s: %s\n" % (date_ts, s.text)

Q-What is the expected output? What do you see instead?
Expected to see the public timeline, but instead see this error-

statuses = api.GetPublicTimeline()
  File "build/bdist.macosx-10.5-i386/egg/twitter.py", line 1329, in 
GetPublicTimeline
  File "/Library/Python/2.5/site-packages/PIL/__init__.py", line 354, in 
loads

  File "build/bdist.macosx-10.5-i386/egg/simplejson/decoder.py", line 
392, in decode
  File "build/bdist.macosx-10.5-i386/egg/simplejson/decoder.py", line 
410, in raw_decode
simplejson.decoder.JSONDecodeError: No JSON object could be decoded: 
line 1 column 0 (char 0)

What version of the product are you using? On what operating system?
Mac OSX- 10.5.7, python 2.5.1, python-twitter 0.6 and 0.7-devel both 
fail, simplejson 2.0.7-2.1.0 all versions fail

Please provide any additional information below.

macports twitter (py25-twitter and py25-simplejson too fail with similar 
decoding errors), removed those versions to avoid conflicts.

Original issue reported on code.google.com by dotpa...@gmail.com on 23 Jul 2009 at 10:02

GoogleCodeExporter commented 9 years ago
I get the exact same error message

Original comment by rawoodru...@googlemail.com on 6 Sep 2009 at 10:54

GoogleCodeExporter commented 9 years ago
I'm seeing that a lot lately, but it's sporadic -- I assumed it was some issue 
on
Twitter's end. Usually I'll get the error a couple of times then the next 
update will
succeed.

Original comment by akkana on 6 Sep 2009 at 11:54

GoogleCodeExporter commented 9 years ago
I have also noticed this....I notice it more on my server than on my local dev 
environment. My server is running 
mod_wsgi, while I'm using Django's runserver locally. I have never seen the 
issue when running the server, 
though I have seen it once or twice in the python shell...

Original comment by neenach2002@gmail.com on 7 Sep 2009 at 9:12

GoogleCodeExporter commented 9 years ago
I confirmed this bug.
I tried both the simplejson trunk and the embedded version.

Original comment by ahlon...@gmail.com on 8 Sep 2009 at 2:00

GoogleCodeExporter commented 9 years ago
I think this is because Twitter is returning an extremely high rate of errors 
today.  Not 
much we can do about that.  Try catching the error and retrying the request?

Original comment by dclinton on 8 Sep 2009 at 2:03

GoogleCodeExporter commented 9 years ago
I gutted out some of the code, and I'm using a very stripped down version that 
just grabs the URL directly...

It appears this is definitely an issue with Twitter and NOT with your API.

The only thing we can do is complain to Twitter if this keeps happening...

Original comment by neenach2002@gmail.com on 8 Sep 2009 at 7:10

GoogleCodeExporter commented 9 years ago
marking as Invalid since this was ultimately a Twitter infrastructure issue

Original comment by bear42 on 16 Oct 2010 at 11:07