I am debugging python code (python2.7.12) as my code works but I get NULL for all variables when streaming tweets into the database.
The error I got is:
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <function _remove at 0x10068f140> ignored
I am assuming this error is from the code below:
def put_tweets_in_database(tweets):
print "putting tweets in database"
errors = 0
count = 0
for tweet in tweets:
try:
commit_tweet_to_database(tweet, count, len(tweets))
count += 1
except Exception as e:
print e
session.rollback()
errors += 1
print 'there were {} errors'.format(errors)
I don't think the function commit_tweet_to_database()
is wrong...
Do you have any idea...? I would appreciate any help!
Thank you.