0

i tried to do unpickling using w+b mode. i got the exception EOFError: ran out of input. why is unpickling not possible in w+b mode? w+b mode also offers reading a binary file right then why am i getting this exception and what does ran out of input means in here

1 Answers1

1

Opening a file in w+b will truncate the file. If you want to open a file for reading and writing without truncation, you should use r+b.

Johan Schiff
  • 661
  • 4
  • 13