1
import redis                                        
import lz4framed                                    
class TestWXRedis(unittest.TestCase):               
    def test_t(self):      
        r=redis.StrictRedis(host=xxx, port=xxxx)                
        result = r.hget("xxxxx","xxxx")                   
        print(result)                               
        print(lz4framed.decompress(result))  

结果的输出:

b'\xba\x00\x00\x00\xf0\xab\x8c\xa4date\xa6180320\xa6status\xc2\xa3aid\xa71204424\xa3cid\xaczg3Kx7pvYRGT\xa3pid\x03\xa2ad\xa528976\xa2ip\xaf183.193.180.218\xa4user\xa881564934\xa4opid\xbcoeEcCxC5_ayjWs_Cez8E5vdph_xY\xa2ei\xaf865454023352746\xa2ts\x00\xa3tid\xbb003f8uj1cnae0buvrfnnsq3lh6v'

错误是:

ERROR: test_t (WXUserCollector.redi.wxredis_test.TestWXRedis)
Traceback (most recent call last):
  File "/home/ymserver/tmp/zengjiwen/wx_public_account/WXUserCollector/redi/wxredis_test.py", line 14, in test_getYmUserInfoByAppidOpenid
    print(lz4framed.decompress(result))
_lz4framed.Lz4FramedError: ('ERROR_frameType_unknown', 13)
4

0 回答 0