[PYTHON MATRIX-SIG] pickle error on Win95
Fredrik Lundh
fredrik_lundh@ivab.se
Wed, 20 Mar 1996 12:08:34 +0100
... fp=open("test","w")
... pickle.dump(m,fp)
... fp.close()
... fp=open("test","r")
... y=pickle.load(fp)
... print y
Hey, you've forgot the "b" flag! The following should work:
... fp=open("test","wb")
... pickle.dump(m,fp)
... fp.close()
... fp=open("test","rb")
... y=pickle.load(fp)
Since text and binary files are not the same thing under DOS (and
some other systems as well), you should always make sure to add "b"
when dealing with binary data. See open() in the python manual for
details.
/F
=================
MATRIX-SIG - SIG on Matrix Math for Python
send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================