arturoqu / python-twitter

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

Sending a status update doesn't work. #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Try to send a status update. api.PostUpdate('text tet text')

What is the expected output? What do you see instead?
I would expect to see nothing, as the update would be posted successfully.
Instead, I got:

api.PostUpdate(data)
File "build/bdist.linux-i686/egg/twitter.py", line 1055, in PostUpdate
File "/usr/lib/python2.5/site-packages/PIL/__init__.py", line 313, in loads    
File "build/bdist.linux-i686/egg/simplejson/decoder.py", line 321, in decode
File "build/bdist.linux-i686/egg/simplejson/decoder.py", line 340, in
raw_decode
ValueError: No JSON object could be decoded

Could it be a problem with simplejson?

I have:
-Ubuntu 8.04 i386
-Python2.5
-simplejson 1.7.3 (distro package), and 1.9.2 (mamually installed
-python-twitter 0.5 and SVN
I tried all combinations of simplejson and python-twitter.

I also fail the install test. This would be a seperate issue, but I believe
they are related. Here is the output from python setup.py test:

running test
running egg_info
writing requirements to python_twitter.egg-info/requires.txt
writing python_twitter.egg-info/PKG-INFO
writing top-level names to python_twitter.egg-info/top_level.txt
writing dependency_links to python_twitter.egg-info/dependency_links.txt
reading manifest file 'python_twitter.egg-info/SOURCES.txt'
writing manifest file 'python_twitter.egg-info/SOURCES.txt'
running build_ext
Test the twitter._FileCache.Get method ... ok
Test the twitter._FileCache.GetCachedTime method ... ok
Test the twitter._FileCache constructor ... ok
Test the twitter._FileCache.Remove method ... ok
Test the twitter._FileCache.Set method ... ok
Test the twitter.Status AsDict method ... ok
Test the twitter.Status AsJsonString method ... FAIL
Test the twitter.Status __eq__ method ... ok
Test all of the twitter.Status getters and setters ... ok
Test the twitter.Status constructor ... ok
Test the twitter.Status NewFromJsonDict method ... ok
Test all of the twitter.Status properties ... ok
Test various permutations of Status relative_created_at ... ok
Test the twitter.User AsDict method ... ok
Test the twitter.User AsJsonString method ... FAIL
Test the twitter.User __eq__ method ... ok
Test all of the twitter.User getters and setters ... ok
Test the twitter.User constructor ... ok
Test the twitter.User NewFromJsonDict method ... ok
Test all of the twitter.User properties ... ok
Test the twitter.Api CreateFriendship method ... ok
Test the twitter.Api DestroyDirectMessage method ... ok
Test the twitter.Api DestroyFriendship method ... ok
Test the twitter.Api DestroyStatus method ... ok
Test the twitter.Api GetDirectMessages method ... ok
Test the twitter.Api GetFeatured method ... ok
Test the twitter.Api GetFollowers method ... ok
Test the twitter.Api GetFriends method ... ok
Test the twitter.Api GetFriendsTimeline method ... ok
Test the twitter.Api GetPublicTimeline method ... ok
Test the twitter.Api GetReplies method ... ok
Test the twitter.Api GetStatus method ... ok
Test the twitter.Api GetUser method ... ok
Test the twitter.Api GetUserTimeline method ... ok
Test the twitter.Api PostDirectMessage method ... ok
Test the twitter.Api PostUpdate method ... ok

======================================================================
FAIL: Test the twitter.Status AsJsonString method
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/daniel/projects/python-twitter-0.5/twitter_test.py", line
121, in testAsJsonString
    self._GetSampleStatus().AsJsonString())
AssertionError: '{"created_at": "Fri Jan 26 23:17:14 +0000 2007", "id":
4391023, "text": "A l\\u00e9gp\\u00e1rn\\u00e1s haj\\u00f3m tele van
angoln\\u00e1kkal.", "user": {"description": "Canvas. JC Penny. Three
ninety-eight.", "id": 718443, "location": "Okinawa, Japan", "name": "Kesuke
Miyagi", "profile_image_url":
"http:\\/\\/twitter.com\\/system\\/user\\/profile_image\\/718443\\/normal\\/kesu
ke.png",
"screen_name": "kesuke", "url": "http:\\/\\/twitter.com\\/kesuke"}}' !=
'{"created_at": "Fri Jan 26 23:17:14 +0000 2007", "id": 4391023, "text": "A
l\\u00e9gp\\u00e1rn\\u00e1s haj\\u00f3m tele van angoln\\u00e1kkal.",
"user": {"description": "Canvas. JC Penny. Three ninety-eight.", "id":
718443, "location": "Okinawa, Japan", "name": "Kesuke Miyagi",
"profile_image_url":
"http://twitter.com/system/user/profile_image/718443/normal/kesuke.png",
"screen_name": "kesuke", "url": "http://twitter.com/kesuke"}}'

======================================================================
FAIL: Test the twitter.User AsJsonString method
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/daniel/projects/python-twitter-0.5/twitter_test.py", line
224, in testAsJsonString
    self._GetSampleUser().AsJsonString())
AssertionError: '{"description": "Indeterminate things", "id": 673483,
"location": "San Francisco, CA", "name": "DeWitt", "profile_image_url":
"http:\\/\\/twitter.com\\/system\\/user\\/profile_image\\/673483\\/normal\\/me.j
pg",
"screen_name": "dewitt", "status": {"created_at": "Fri Jan 26 17:28:19
+0000 2007", "id": 4212713, "text": "\\"Select all\\" and archive your
Gmail inbox.  The page loads so much faster!"}, "url":
"http:\\/\\/unto.net\\/"}' != '{"description": "Indeterminate things",
"id": 673483, "location": "San Francisco, CA", "name": "DeWitt",
"profile_image_url":
"http://twitter.com/system/user/profile_image/673483/normal/me.jpg",
"screen_name": "dewitt", "status": {"created_at": "Fri Jan 26 17:28:19
+0000 2007", "id": 4212713, "text": "\\"Select all\\" and archive your
Gmail inbox.  The page loads so much faster!"}, "url": "http://unto.net/"}'

----------------------------------------------------------------------
Ran 36 tests in 0.309s

FAILED (failures=2)

Thanks,
Daniel

Original issue reported on code.google.com by dlagesse...@gmail.com on 18 Jul 2008 at 4:51

GoogleCodeExporter commented 9 years ago
Good bug report.  Accepting and looking into this...

Original comment by dclinton on 19 Jul 2008 at 2:42

GoogleCodeExporter commented 9 years ago
I had an error in my program causing the first problem. For some reason the 
data sent
to PostUpdate() wasn't text? I changed it, and now that works. 

I still fail the python setup.py test, however.

Daniel

Original comment by dlagesse...@gmail.com on 19 Jul 2008 at 2:53

GoogleCodeExporter commented 9 years ago
I'm have the exact same error message. I'm running Ubuntu Intrepid..

Original comment by misha.th...@gmail.com on 5 Jan 2009 at 6:57

GoogleCodeExporter commented 9 years ago
This should be fixed now with the bundled simplejson.  Please verify again.

Original comment by dclinton on 21 Feb 2009 at 5:29