0

I am trying to unpickle a file received from someone else (which is to say I don't have access to the source code). On trying pickle.load(filename) I get the following error:

_pickle.UnpicklingError: invalid load key, '\x01'

I know that the pickle file also tries to import some outdated modules and am not sure if that is causing the problem?

Some answers on SO suggest not unpickling a file that I don't trust. In that case is my only option asking the owner to send me an unpickled version?

martineau
  • 119,623
  • 25
  • 170
  • 301
rahs
  • 1,759
  • 2
  • 15
  • 31
  • It sounds like the object you're trying to unpickle may have some complexity to it - does this answer your question? https://stackoverflow.com/questions/33049688/what-causes-the-error-pickle-unpicklingerror-invalid-load-key – Grismar Feb 18 '21 at 00:12
  • @Grismar Thanks. I believe that post was to do with multiple unpickling calls on different parts of a file, while I am just calling it once on the file as a whole. – rahs Feb 18 '21 at 01:45

0 Answers0