Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1e01203

Browse files
committed
few just in case "patches"
1 parent d908d07 commit 1e01203

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

lib/core/common.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3092,6 +3092,8 @@ def decodeHexValue(value):
30923092
Returns value decoded from DBMS specific hexadecimal representation
30933093
"""
30943094

3095+
retVal = value
3096+
30953097
def _(value):
30963098
if value and isinstance(value, basestring) and len(value) % 2 == 0:
30973099
if value.lower().startswith("0x"):
@@ -3109,7 +3111,12 @@ def _(value):
31093111
pass
31103112
return value
31113113

3112-
return applyFunctionRecursively(value, _)
3114+
try:
3115+
retVal = applyFunctionRecursively(value, _)
3116+
except Exception:
3117+
singleTimeWarnMessage("there was a problem decoding value '%s' from expected hexadecimal form" % value)
3118+
3119+
return retVal
31133120

31143121
def extractExpectedValue(value, expected):
31153122
"""

lib/utils/hashdb.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import threading
1313
import time
1414

15+
from lib.core.common import getUnicode
1516
from lib.core.common import serializeObject
1617
from lib.core.common import unserializeObject
1718
from lib.core.settings import HASHDB_FLUSH_THRESHOLD
@@ -74,7 +75,7 @@ def write(self, key, value, serialize=False):
7475
if key:
7576
hash_ = HashDB.hashKey(key)
7677
self._cache_lock.acquire()
77-
self._write_cache[hash_] = value if not serialize else serializeObject(value)
78+
self._write_cache[hash_] = getUnicode(value) if not serialize else serializeObject(value)
7879
self._cache_lock.release()
7980

8081
if getCurrentThreadName() in ('0', 'MainThread'):

0 commit comments

Comments
 (0)