Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RuntimeError: LZ4F_decompress failed with code: ERROR_frameType_unknown. #19

Open
MindaugasVaitkus2 opened this issue Jun 30, 2018 · 0 comments

Comments

@MindaugasVaitkus2
Copy link

I install python 3.7 and use code below from lz4 documentation to read mozzila firefox compressed json file to decompress to json file to extract bookmarks. I get error RuntimeError: LZ4F_decompress failed with code: ERROR_frameType_unknown.

import json
import os
import lz4.frame

testfile = "C:\Users\Vartotojas\application data\mozilla\firefox\Profiles\8zco1w2p.default-1520716267057\bookmarkbackups\bookmarks-2018-06-30_23_zKtuViq4dpuCfZ3hgk47jg==.jsonlz4"
testfile1 = "testfile_1.json"

input_data = 20 * os.urandom(1024)
with lz4.frame.open('testfile1', mode='wb') as fp:
bytes_written = fp.write(input_data)
bytes_written == len(input_data)

with lz4.frame.open(testfile, mode='r') as fp:
output_data = fp.read()
output_data == input_data

output_data = fp.read()

File "C:\Users\Vartotojas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lz4\frame_init_.py", line 635, in read
return self._buffer.read(size)
File "C:\Users\Vartotojas\AppData\Local\Programs\Python\Python37-32\lib_compression.py", line 103, in read
data = self.decompressor.decompress(rawblock, size)
File "C:\Users\Vartotojas\AppData\Local\Programs\Python\Python37-32\lib\site-packages\lz4\frame_init
.py", line 398, in decompress
return_bytearray=self._return_bytearray,
RuntimeError: LZ4F_decompress failed with code: ERROR_frameType_unknown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant