Re-implemented copyreg picklers/unpicklers for DAL and Reference classes (due to errors on sessions)
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
import copy
|
||||
import marshal
|
||||
import struct
|
||||
import traceback
|
||||
|
||||
from .._compat import exists
|
||||
from .._compat import exists, copyreg
|
||||
from .._globals import LOGGER
|
||||
|
||||
|
||||
@@ -45,6 +47,18 @@ class Reference(long):
|
||||
self.__allocate()
|
||||
self._record[key] = value
|
||||
|
||||
def Reference_unpickler(data):
|
||||
return marshal.loads(data)
|
||||
|
||||
def Reference_pickler(data):
|
||||
try:
|
||||
marshal_dump = marshal.dumps(long(data))
|
||||
except AttributeError:
|
||||
marshal_dump = 'i%s' % struct.pack('<i', long(data))
|
||||
return (Reference_unpickler, (marshal_dump,))
|
||||
|
||||
copyreg.pickle(Reference, Reference_pickler, Reference_unpickler)
|
||||
|
||||
|
||||
class SQLCallableList(list):
|
||||
def __call__(self):
|
||||
|
||||
Reference in New Issue
Block a user