I have several scripts running on a server that saw and paste various dictionaries. They all use the same base code for etching, as shown below:
SellerDict=open('/home/hostadl/SellerDictkm','rb') SellerDictionarykm=pickle.load(SellerDict) SellerDict.close() SellerDict=open('/home/hostadl/SellerDictkm','wb') pickle.dump(SellerDictionarykm,SellerDict) SellerDict.close()
All scripts work fine, except for one of them. One that has problems gets to various sites and dumps data and stores it in a dictionary. This code works all day etching and putting up dictionaries and stops at midnight. Then a cronjob starts it again the next morning. This script can run for several weeks without problems, but about once a month the script dies due to EOFError when trying to open a dictionary. The size of dictionaries is usually around 80 MB. I even tried adding SellerDict.flush () before SellerDict.close () when poisoning the data to make sure the evening was red.
Any idea what could be causing this? Python is pretty solid, so I don't think this is due to file size. When the code works fine for a long time before dying, it makes me think that maybe something is stored in the dictionary that causes this problem, but I have no idea.
Also, if you know the best way to save dictionaries other than pickle, I am open to options. As I said, dictionaries are constantly opening and closing. Just to clarify, only one program will use the same dictionary so that the problem is not caused by several programs trying to access the same dictionary.
UPDATE:
Here is the trace that I have from the log file.
Traceback (most recent call last): File "/home/hostadl/CompileRecentPosts.py", line 782, in <module> main() File "/home/hostadl/CompileRecentPosts.py", line 585, in main SellerDictionarykm=pickle.load(SellerDict) EOFError
source share