これは私の機能です:
def pickleIt(file_name,data):
try:
with open(file_name+".pickle", "wb") as output_file:
pickle.dump(data, output_file,-1)
output_file.close()
except Exception,e:
print "Cannot open the file:",file_name,e
return
辞書やリストをピクルスにするとうまくいきますが、辞書のリストではうまくいきません。別の関数から辞書を取得し、single_record
それをリストに追加します。
def set_dict(url.....)
single_record={'url':url,
'title':song_obj.getSongTitle(),
'name':song_obj.getPerformer(),
'author':song_obj.getAuthors(),
}
return single_record
50個のdictのリストをダンプしようとすると、次のエラーが発生します。
maximum recursion depth exceeded
誰かがそれの何が悪いのかを見つけるのを手伝ってもらえますか?