Issue222879

classification
Title: Unpickler.load_long() bug
Type: Severity: normal
Components: Core Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn
Priority: low Keywords:

Created on 2000-11-18.19:49:37 by bckfnn, last changed 2000-11-18.23:25:10 by bckfnn.

Messages
msg207 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.19:49:37
pickle.Unpickler.load_long() has bug, which does not allow to unpickle long
values.

Version of pickle.Unpickler.load_long I had:

    def load_long(self):
        self.append(string.atol(self.readline()[:-1], 0))
    dispatch[LONG] = load_long

Possible fix (it works for me):

    def load_long(self):
        self.append(string.atol(self.readline()[:-2]))
    dispatch[LONG] = load_long


How to check:
import pickle
l=123L
s=pickle.dumps(l,1)
o=pickle.loads(s)

msg208 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.23:25:10
Fixed PyString by allowing trailing L in atol.
History
Date User Action Args
2000-11-18 19:49:37bckfnncreate