python - pickle.load() raising EOFError in Windows -
this how code
with open(pickle_f, 'r') fhand: obj = pickle.load(fhand) this works fine on linux systems not on windows. showing eoferror. have use rb mode make work on windows.. isn't working on linux.
why happening, , how fix it?
always use b mode when reading , writing pickles (open(f, 'wb') writing, open(f, 'rb') reading). "fix" file have, convert newlines using dos2unix.
Comments
Post a Comment