Re-implemented copyreg picklers/unpicklers for DAL and Reference classes (due to errors on sessions)

This commit is contained in:
gi0baro
2014-09-03 14:48:26 +02:00
parent 5e5e649c28
commit 625e4849ef
3 changed files with 29 additions and 3 deletions
+3 -1
View File
@@ -7,13 +7,15 @@ PY2 = sys.version_info[0] == 2
if PY2:
import cPickle as pickle
import cStringIO as StringIO
import copy_reg as copyreg
hashlib_md5 = hashlib.md5
else:
import pickle
from io import StringIO
import copyreg
hashlib_md5 = lambda s: hashlib.md5(bytes(s,'utf8'))
pjoin = os.path.join
exists = os.path.exists
ogetattr = object.__getattribute__
osetattr = object.__setattr__
osetattr = object.__setattr__