Patching session PY2<->PY3 incompatibility issue

This commit is contained in:
Miroslav Stampar 2020-09-09 16:15:23 +02:00
parent 1658331810
commit 715063f0d4
3 changed files with 5 additions and 5 deletions

View File

@ -4774,7 +4774,7 @@ def serializeObject(object_):
""" """
Serializes given object Serializes given object
>>> type(serializeObject([1, 2, 3, ('a', 'b')])) == six.binary_type >>> type(serializeObject([1, 2, 3, ('a', 'b')])) == str
True True
""" """

View File

@ -48,16 +48,16 @@ def base64pickle(value):
retVal = None retVal = None
try: try:
retVal = encodeBase64(pickle.dumps(value, PICKLE_PROTOCOL)) retVal = encodeBase64(pickle.dumps(value, PICKLE_PROTOCOL), binary=False)
except: except:
warnMsg = "problem occurred while serializing " warnMsg = "problem occurred while serializing "
warnMsg += "instance of a type '%s'" % type(value) warnMsg += "instance of a type '%s'" % type(value)
singleTimeWarnMessage(warnMsg) singleTimeWarnMessage(warnMsg)
try: try:
retVal = encodeBase64(pickle.dumps(value)) retVal = encodeBase64(pickle.dumps(value), binary=False)
except: except:
retVal = encodeBase64(pickle.dumps(str(value), PICKLE_PROTOCOL)) retVal = encodeBase64(pickle.dumps(str(value), PICKLE_PROTOCOL), binary=False)
return retVal return retVal

View File

@ -18,7 +18,7 @@ from lib.core.enums import OS
from thirdparty.six import unichr as _unichr from thirdparty.six import unichr as _unichr
# sqlmap version (<major>.<minor>.<month>.<monthly commit>) # sqlmap version (<major>.<minor>.<month>.<monthly commit>)
VERSION = "1.4.9.7" VERSION = "1.4.9.8"
TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable" TYPE = "dev" if VERSION.count('.') > 2 and VERSION.split('.')[-1] != '0' else "stable"
TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34} TYPE_COLORS = {"dev": 33, "stable": 90, "pip": 34}
VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE) VERSION_STRING = "sqlmap/%s#%s" % ('.'.join(VERSION.split('.')[:-1]) if VERSION.count('.') > 2 and VERSION.split('.')[-1] == '0' else VERSION, TYPE)