Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with list_direct_messages #1261

Closed
nate-vasagam opened this issue Aug 25, 2019 · 1 comment · Fixed by #1262
Closed

Bug with list_direct_messages #1261

nate-vasagam opened this issue Aug 25, 2019 · 1 comment · Fixed by #1262
Assignees
Labels
API This is regarding Twitter's API Bug This is regarding a bug with the library
Milestone

Comments

@nate-vasagam
Copy link

Hi,

I'm trying to use the list_direct_messages api but any time I try to iterate through the items it returns I get this error

Traceback (most recent call last):
File "reply_dm.py", line 41, in
main()
File "reply_dm.py", line 36, in main
check_messages(api)
File "reply_dm.py", line 29, in check_messages
for message in tweepy.Cursor(api.list_direct_messages).items():
File "C:\Python27\bot\twitter\lib\site-packages\tweepy\cursor.py", line 195, in next
self.current_page = self.page_iterator.next()
File "C:\Python27\bot\twitter\lib\site-packages\tweepy\cursor.py", line 73, in next
**self.kargs)
File "C:\Python27\bot\twitter\lib\site-packages\tweepy\binder.py", line 250, in _call
return method.execute()
File "C:\Python27\bot\twitter\lib\site-packages\tweepy\binder.py", line 233, in execute
raise TweepError(error_msg, resp, api_code=api_error_code)
tweepy.error.TweepError: [{u'message': u'invalid cursor', u'code': 214}]

Now, I may be doing something wrong, but I tested a few other API methods such as followers and others and those worked (so I think I'm using cursors properly).

Can anyone confirm this is working in their version of Python?

@Harmon758 Harmon758 added Bug This is regarding a bug with the library API This is regarding Twitter's API labels Aug 25, 2019
@Harmon758 Harmon758 self-assigned this Aug 25, 2019
@Harmon758
Copy link
Member

I've made a branch and pull request to fix this. See #1262 for more details.

I'd have liked to release the fix in a v3.8.1 patch release, but I think the change requiring parsers to handle a new return_cursors kwarg warrants waiting until a v3.9 minor version update.

For code block usage, see https://help.github.com/articles/creating-and-highlighting-code-blocks/.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API This is regarding Twitter's API Bug This is regarding a bug with the library
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants