fix AttributeError for python 3

got error with python3 

>> return pickle.loads(rv[' p'].encode('utf-8'))
>> AttributeError: 'bytes' object has no attribute 'encode'

add try/except