Skip to content
This repository was archived by the owner on Aug 7, 2024. It is now read-only.
This repository was archived by the owner on Aug 7, 2024. It is now read-only.

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

Closed

Description

@bastbnl

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'

Activity

  1. bastbnl commented on Nov 7, 2018

    @bastbnl
    Author

    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}]

  2. mazjindeel commented on Nov 17, 2018

    @mazjindeel

    I am encountering this issue as well, for send_direct_message.

  3. rogodani commented on Nov 18, 2018

    @rogodani

    I have the same issue using python 3.6.5

  4. maheraudee commented on Nov 23, 2018

    @maheraudee

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

  5. jeremylow commented on Nov 27, 2018

    @jeremylow
    Collaborator

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

  6. gabriele99g commented on Dec 5, 2018

    @gabriele99g

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

  7. PythonCoderAS commented on Mar 19, 2019

    @PythonCoderAS

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

  8. PythonCoderAS commented on Mar 19, 2019

    @PythonCoderAS

    Anyone that needs a quick fix can go to this comment

  9. chrischma commented on Oct 9, 2021

    @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?

  10. PythonCoderAS commented on Oct 9, 2021

    @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?

    use a different API, this one is basically dead

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions