[Python-checkins] CVS: python/dist/src/Lib pickle.py,1.50,1.51
Tim Peters
tim_one@users.sourceforge.net
Tue, 28 Aug 2001 15:21:20 -0700
Update of /cvsroot/python/python/dist/src/Lib
In directory usw-pr-cvs1:/tmp/cvs-serv15915/Lib
Modified Files:
pickle.py
Log Message:
pickle.py, load_int(): Match cPickle's just-repaired ability to unpickle
64-bit INTs on 32-bit boxes (where they become longs). Also exploit that
int(str) and long(str) will ignore a trailing newline (saves creating a
new string at the Python level).
pickletester.py: Simulate reading a pickle produced by a 64-bit box.
Index: pickle.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/pickle.py,v
retrieving revision 1.50
retrieving revision 1.51
diff -C2 -d -r1.50 -r1.51
*** pickle.py 2001/08/17 18:49:52 1.50
--- pickle.py 2001/08/28 22:21:18 1.51
***************
*** 616,620 ****
def load_int(self):
! self.append(int(self.readline()[:-1]))
dispatch[INT] = load_int
--- 616,624 ----
def load_int(self):
! data = self.readline()
! try:
! self.append(int(data))
! except ValueError:
! self.append(long(data))
dispatch[INT] = load_int