From 98a3e43f530d8f39a35fefdf2543920f6eea7092 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 8 Mar 2012 10:57:47 +0000 Subject: [PATCH] bug fix for writing raw pickled data into SQLite HashDB --- lib/core/common.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/core/common.py b/lib/core/common.py index 78a00bb77..423f49697 100644 --- a/lib/core/common.py +++ b/lib/core/common.py @@ -54,6 +54,8 @@ from lib.core.data import conf from lib.core.data import kb from lib.core.data import logger from lib.core.data import paths +from lib.core.convert import base64pickle +from lib.core.convert import base64unpickle from lib.core.convert import htmlunescape from lib.core.convert import unicodeencode from lib.core.convert import urldecode @@ -3071,7 +3073,7 @@ def serializeObject(object_): Serializes given object """ - return pickle.dumps(object_) + return base64pickle(object_) def unserializeObject(value): """ @@ -3080,7 +3082,7 @@ def unserializeObject(value): retVal = None if value: - retVal = pickle.loads(value.encode(UNICODE_ENCODING)) # pickle has problems with Unicode + retVal = base64unpickle(value) return retVal def resetCounter(technique):