did typecasting to avoid exception

changed the variables conf.port, key. HASHDB_MILESTONE_VALUE to string so that the exception wont raise..
This commit is contained in:
aayush reddy 2018-06-19 12:50:53 +05:30 committed by GitHub
parent 756f02fb0e
commit ad8058b639
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4281,7 +4281,7 @@ def hashDBWrite(key, value, serialize=False):
Helper function for writing session data to HashDB Helper function for writing session data to HashDB
""" """
_ = '|'.join((conf.hostname, conf.path.strip('/') if conf.path is not None else str(conf.port), key, HASHDB_MILESTONE_VALUE)) _ = '|'.join((conf.hostname, conf.path.strip('/') if conf.path is not None else str(conf.port), str(key), str(HASHDB_MILESTONE_VALUE)))
conf.hashDB.write(_, value, serialize) conf.hashDB.write(_, value, serialize)
def hashDBRetrieve(key, unserialize=False, checkConf=False): def hashDBRetrieve(key, unserialize=False, checkConf=False):
@ -4289,7 +4289,7 @@ def hashDBRetrieve(key, unserialize=False, checkConf=False):
Helper function for restoring session data from HashDB Helper function for restoring session data from HashDB
""" """
_ = '|'.join((conf.hostname, conf.path.strip('/') if conf.path is not None else str(conf.port), key, HASHDB_MILESTONE_VALUE)) _ = '|'.join((conf.hostname, conf.path.strip('/') if conf.path is not None else str(conf.port), str(key), str(HASHDB_MILESTONE_VALUE)))
retVal = conf.hashDB.retrieve(_, unserialize) if kb.resumeValues and not (checkConf and any((conf.flushSession, conf.freshQueries))) else None retVal = conf.hashDB.retrieve(_, unserialize) if kb.resumeValues and not (checkConf and any((conf.flushSession, conf.freshQueries))) else None
if not kb.inferenceMode and not kb.fileReadMode and isinstance(retVal, basestring) and any(_ in retVal for _ in (PARTIAL_VALUE_MARKER, PARTIAL_HEX_VALUE_MARKER)): if not kb.inferenceMode and not kb.fileReadMode and isinstance(retVal, basestring) and any(_ in retVal for _ in (PARTIAL_VALUE_MARKER, PARTIAL_HEX_VALUE_MARKER)):