私のコードとしてPythonコード(python2.7.12)をデバッグしていますが、データベースにツイートをストリーミングするときにすべての変数がNULLになります。Exception AttributeError: "'NoneType'オブジェクトに 'path'属性がありません。
私が得たエラーは、次のとおりです。私はこのエラーを想定しています
Exception AttributeError: "'NoneType' object has no attribute 'path'" in <function _remove at 0x10068f140> ignored
次のコードからさ:
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)
私は...
機能commit_tweet_to_database()
が間違っているとは思いません
あなたは何か考えていますか?私はどんな助けもありがとう!
ありがとうございます。
コンテキストにユーザ定義の '_remove'がないと賭けています。エラーの行番号がなく、ループの繰り返しの間に例外が発生します。だから私はそれがループのイテレータと関係があり、おそらくPythonのバグだと思っています。 –
注:エラーは 'pdb'(韻を意図していません)でコードをステップ実行するときにのみ発生します。 –