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

TypeError: '>' not supported between instances of 'NoneType' and 'int' #49

Closed
colemickens opened this issue Sep 14, 2019 · 3 comments · Fixed by #52
Closed

TypeError: '>' not supported between instances of 'NoneType' and 'int' #49

colemickens opened this issue Sep 14, 2019 · 3 comments · Fixed by #52

Comments

@colemickens
Copy link

# python deletetweets.py -d 2019-09-14 ../TWITTER2/tweet.js 
Traceback (most recent call last):
  File "deletetweets.py", line 112, in <module>
    main()
  File "deletetweets.py", line 108, in main
    delete(args.file, args.date, args.restrict, args.spare_ids, args.min_likes, args.min_retweets)
  File "deletetweets.py", line 77, in delete
    for row in TweetReader(tweets, date, r, s, min_l, min_r).read():
  File "deletetweets.py", line 59, in read
    if (self.min_likes > 0 and int(row.get("favorite_count")) >= self.min_likes) or \
TypeError: '>' not supported between instances of 'NoneType' and 'int'
@blip-lorist
Copy link

blip-lorist commented Sep 15, 2019

Noticed this same error - looks like min_l and min_r are coming in as None if they are not provided as command line arguments. Passing None into this function overrides the default int values set in the TweetReader constructor.

I've got a working branch reproducing this error in a unit test, will send a fix by in a PR shortly.

@colemickens
Copy link
Author

Thanks! Passing the CLI args worked in the meantime.

@koenrh
Copy link
Owner

koenrh commented Sep 21, 2019

Thanks for reporting.

I've got a working branch reproducing this error in a unit test, will send a fix by in a PR shortly.

🙌

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants