can not decompress lz4 bytes in python

0 votes
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))  

the output of 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'

and the error is:

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)

Oct 4, 2018 in Python by eatcodesleeprepeat
• 4,670 points
96 views

1 answer to this question.

0 votes

We need an Minimal, Complete, and Verifiable example to be able to help with this. The problem seems to be that you can't decompress result - what data was used to produce result? How exactly did you compress it? 

answered Oct 4, 2018 by Priyaj
• 56,520 points

Related Questions In Python

+3 votes
7 answers

How can I rename a file in Python?

yes, you can use "os.rename" for that. ...READ MORE

answered Mar 31, 2018 in Python by DareDev
• 6,810 points
129 views
+2 votes
2 answers

How can I create a new file in Python?

You can try the below code which ...READ MORE

answered Mar 31, 2018 in Python by anto.trigg4
• 3,420 points
91 views
+2 votes
6 answers

How can I change directory or "cd" in Python?

Context Manager: cd import os class cd:     """Context manager for ...READ MORE

answered Oct 18, 2018 in Python by Nabarupa
101 views
0 votes
1 answer

How can I compare the content of two files in Python?

Assuming that your file unique.txt just contains ...READ MORE

answered Apr 16, 2018 in Python by charlie_brown
• 7,720 points
95 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 226 views
0 votes
1 answer

can not decompress lz4 bytes in python

You could try these python LZ4 bindings rather than ...READ MORE

answered Oct 9, 2018 in Python by Priyaj
• 56,520 points
36 views
+2 votes
3 answers

How can I play an audio file in the background using Python?

down voteacceptedFor windows: you could use  winsound.SND_ASYNC to play them ...READ MORE

answered Apr 3, 2018 in Python by charlie_brown
• 7,720 points
1,696 views