python-twitter icon indicating copy to clipboard operation
python-twitter copied to clipboard

`twitter.error.TwitterError: [{'message': 'Sorry, that page does not exist.', 'code': 34}]` while trying to get direct messages

Open bastbnl opened this issue 8 years ago • 10 comments

I'm getting a twitter.error.TwitterError: [{'code': 34, 'message': 'Sorry, that page does not exist'}] on python 3.5 using python-twitter==3.5.0. I've been reading through an older issue #587 and that doesn't seem to work properly.

Api.GetDirectMessages uses url = '%s/direct_messages.json' % self.base_url (https://github.com/bear/python-twitter/blob/v3.5/twitter/api.py#L2920), which appears to be the old url.

I changed it to url = '%s/direct_messages/events/list.json' % self.base_url and now run into this:

Traceback (most recent call last):
  File "<console>", line 1, in <module>
  File "/var/www/brownpapersession/alpha/brownpapersession/various/tweet.py", line 62, in get_direct_messages
    messages = twitter.GetDirectMessages()
  File "/var/www/brownpapersession/alpha/env/lib/python3.5/site-packages/twitter/api.py", line 2943, in GetDirectMessages
    return [DirectMessage.NewFromJsonDict(x) for x in data]
  File "/var/www/brownpapersession/alpha/env/lib/python3.5/site-packages/twitter/api.py", line 2943, in <listcomp>
    return [DirectMessage.NewFromJsonDict(x) for x in data]
  File "/var/www/brownpapersession/alpha/env/lib/python3.5/site-packages/twitter/models.py", line 88, in NewFromJsonDict
    json_data = data.copy()
AttributeError: 'str' object has no attribute 'copy'

bastbnl avatar Nov 07 '18 09:11 bastbnl

Deleting a message via the same API appears to fail as well: twitter.DestroyDirectMessage() raises twitter.error.TwitterError: [{'message': 'Sorry, that page does not exist.', 'code': 34}]

bastbnl avatar Nov 07 '18 10:11 bastbnl

I am encountering this issue as well, for send_direct_message.

mazjindeel avatar Nov 17 '18 19:11 mazjindeel

I have the same issue using python 3.6.5

rogodani avatar Nov 18 '18 06:11 rogodani

i have same problem with python 3.7 is there any solution ? is it work with old python version anyone test?

maheraudee avatar Nov 23 '18 11:11 maheraudee

That endpoint was deprecated. It’s not your python version. We’ll be working on implementing support for the new endpoints shortly.

jeremylow avatar Nov 27 '18 16:11 jeremylow

The issue is still present. (twitter-python version: 3.5)

gabriele99g avatar Dec 05 '18 18:12 gabriele99g

The issue is still very present as can be seen by my thread in Feb. 2 that still hasn't done anything.

PythonCoderAS avatar Mar 19 '19 23:03 PythonCoderAS

Anyone that needs a quick fix can go to this comment

PythonCoderAS avatar Mar 19 '19 23:03 PythonCoderAS

That endpoint was deprecated. It’s not your python version. We’ll be working on implementing support for the new endpoints shortly.

any news?

chrischma avatar Oct 09 '21 08:10 chrischma

That endpoint was deprecated. It’s not your python version. We’ll be working on implementing support for the new endpoints shortly.

any news?

use a different API, this one is basically dead

PythonCoderAS avatar Oct 09 '21 15:10 PythonCoderAS