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,710 points
1,188 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
• 58,020 points

Related Questions In Python

0 votes
0 answers

Python error "ERROR: Can not perform a '--user' install. User site-packages are not visible in this virtualenv."

I tried upgrading pip using the following ...READ MORE

Oct 3, 2019 in Python by Hannah
• 18,520 points
6,088 views
+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,890 points
20,076 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,440 points
1,338 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
28,932 views
0 votes
2 answers
+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 7, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 4,465 views
0 votes
1 answer
+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 4, 2018 in Python by charlie_brown
• 7,720 points
13,584 views
0 votes
1 answer

How can I check for NaN in Python?

math.isnan() Checks if the float x is a ...READ MORE

answered Aug 16, 2018 in Python by Priyaj
• 58,020 points
24,274 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP