New issue 161 by pete.doughty: HTTP Error 401 every time.
http://code.google.com/p/python-twitter/issues/detail?id=161
What steps will reproduce the problem?
1. install simplejson and python-twitter (...duh)
2. run the following:
api = twitter.Api(username = '[correct uname', password = '[correct...
pwd]')
api.PostUpdate('word')
3. receive HTTPError: HTTP Error 401: Unauthorized
What is the expected output? What do you see instead?
I was expecting a new tweet on the account, consisting of "word". Instead,
I get that 401 error every single time. This first occurred about a week
and a half ago in a program that had been working fine for the preceding
couple of months.
What version of the product are you using? On what operating system?
Python 2.4 on XP, simplejson 2.0.9, python-twitter 0.5.
Then switched to simplejson 2.1.1, python-twitter 0.6, in case there was a
problem with one of the older versions.
Please provide any additional information below.
I suspect this is twitters problem rather than python-twitter's. But any
light (at all) that could be shed on it would help.
A bit more detail: the full error response I get is:
File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py",
line
307, in RunScript
debugger.run(codeObject, __main__.__dict__, start_stepping=0)
File "C:\Python24\Lib\site-packages\pythonwin\pywin\debugger\__init__.py",
line 60, in run
_GetCurrentDebugger().run(cmd, globals,locals, start_stepping)
File "C:\Python24\Lib\site-packages\pythonwin\pywin\debugger\debugger.py",
line 631, in run
exec cmd in globals, locals
File "C:\Documents and Settings\Peter Doughty\My Documents\Work\Python
Scripts\temp.py", line 15, in ?
api.PostUpdate('word')
File "build\bdist.win32\egg\twitter.py", line 1494, in PostUpdate
File "build\bdist.win32\egg\twitter.py", line 2018, in _FetchUrl
File "C:\Python24\lib\urllib2.py", line 364, in open
response = meth(req, response)
File "C:\Python24\lib\urllib2.py", line 471, in http_response
response = self.parent.error(
File "C:\Python24\lib\urllib2.py", line 402, in error
return self._call_chain(*args)
File "C:\Python24\lib\urllib2.py", line 337, in _call_chain
result = func(*args)
File "C:\Python24\lib\urllib2.py", line 480, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 401: Unauthorized
I have checked and rechecked the username and password.
Hi Pete,
You are right that the problem is with twitter rather than python-twitter
for the most part. Twitter has changed its authorization method
from "username and password" to using oauth which requires a key and a
secret. They've phased out the old method and python-twitter hasn't made a
stable release utilizing this method. You can use
http://code.google.com/p/oauth-python-twitter/ instead while waiting for
the new python-twitter release.
--
You received this message because you are subscribed to the Google Groups "python-twitter" group.
To post to this group, send email to python-...@googlegroups.com.
To unsubscribe from this group, send email to python-twitte...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/python-twitter?hl=en.
Comment #3 on issue 161 by bear42: HTTP Error 401 every time.
http://code.google.com/p/python-twitter/issues/detail?id=161
Please try this with the very latest code double-checking that 1) you are
using oAuth key/secret values and that the simplegeo fork of python-oauth2
is used. I had made a mistake in the docs pointing everyone to another
oauth2 lib.
so just instead of username/password we use the key/secret ?
yes - the latest code has been updated to use those parameter names now.
pretty sure you forgot to upload it - because with the version i downloaded
it does not work - at least not python-twitter. will try oauth-twitter from
you guys, but this is kinda hard to get around with if it is a distributed
all over the place. should have a notice on the start page, something
redirecting, if you want everyone to use oauth
addendum: perhaps an update to you examples on the front page might be nice?
i have been getting the same issues again and again.... has the changes
been committed to use the token key and password
I installed this yesterday and gave up on getting auth to work. The
examples on the web page or the ones included with the packages don't work.
There are no good examples for using oauth in oauth-twitter either. I gave
up and used tweepy
http://jeffmiller.github.com/2010/05/31/twitter-from-the-command-line-in-python-using-oauth
When will there be a new release of python-twitter to fix this?
I really don't understand why you all are saying that python-twitter
doesn't support oauth. Sure it may only be in the trunk right now, but you
can follow the notes in the README which says that Twitter now only
supports oAuth and the Twitter docs about oAuth describe how to get your
consumer_key and consumer_secret.
Once you have those you then run the get_access_token.py script to generate
the rest of the data.
Yea, Twitter and oAuth are complicated, heck it took me almost a week to
get python-twitter to work with the python oauth lib, but it does work.
I have been correcting the odd doc locations that I wasn't aware of as I
find (or am told about them) - so if you find some let me know.
I didn't say it doesn't support it. I was just asking when there will be a
new release. I didn't know how to use trunk or oauth-twitter or
python-oauth2.
The example tweet.py with the latest package of python-twitter is wrong. I
guess it is because 0.6 is from July 2009.
ahh - then I need to apologize as I thought you were using the trunk source.
yes, getting a release has been at the top of my mind, just need to find
some focus time.
again, sorry for jumping all over ya for the wrong thing! doh!