I think the cause of the problem is this line entry = pickle.load(fo,encoding='latin1')
entry = pickle.load(fo,encoding='latin1')