question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:3
  • Comments:10

github_iconTop GitHub Comments

1reaction
PythonCoderAScommented, Mar 19, 2019

Anyone that needs a quick fix can go to this comment

1reaction
jeremylowcommented, Nov 27, 2018

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

Read more comments on GitHub >

github_iconTop Results From Across the Web

Twitter API Response Codes & Error Support - Twitter Developer
The Twitter API provides the following response and error codes to help understand and debug in the moment.Use the debugging guide and error...
Read more >
[ { "code" : 34 , "message" : "Sorry, that page does not exist ...
Hello, my coworker has reported theses same bugs before: Direct messages - Error code 34 on call direct_messages/events/show - #2 by ...
Read more >
Sorry, that page does not exist code 34 - Stack Overflow
A quick way to verify whether the users in the exception really have deleted their account/status will be go and check on twitter....
Read more >
Twitter Page In Uiwebview Redirects To 'Sorry, That ... - ADocLib
TwitterError: [{'message': 'Sorry, that page does not exist.', 'code': 34}]` while trying to get direct messages. I'm getting a twitter.error.TwitterError:.
Read more >
Python - API.destroy_direct_message() in Tweepy
print ( "This direct message no longer exists." ) ... tweepy.error.TweepError: [{'code': 34, 'message': 'Sorry, that page does not exist.'}].
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found