fancycode / pylzma

Python bindings for the LZMA library

Home Page:http://www.joachim-bauch.de/projects/pylzma/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

segmentation fault on tab expansion on decompressobj_compat instance

osiyuk opened this issue · comments

All i need is to decompress lzma with uncompressed size in header and without EOS marker,
according to specification

In [1]: import pylzma

In [2]: dec = pylzma.decompressobj_compat()

In [3]: dec.decompress
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-4355ac622de5> in <module>()
----> 1 dec.decompress

AttributeError: 'LZMACompatDecompress' object has no attribute 'decompress'

In [4]: dec.Segmentation fault

Actually i`ve achieved it by manually parsing header:

import pylzma
import struct

f = open(archive, 'r')
header = f.read(13)
size = struct.unpack('=BIQ', header)[-1]

dec = pylzma.decompressobj(maxlength=size)
dec.decompress(header[:5])

assert 13 == f.tell()
s = dec.decompress(f.read()) # this should be optimized for large files

By the way, i don`t understand compat part of source. Also its very unusual to get Segfault in python shell :)

Sorry, I'm not sure how to reproduce the crash. Could you please provide a short script I can use to trigger it? Also you don't mention which version of Python you are using, on which OS and which version/commit of pylzma.

Closing as too old. Please reopen with further information if this is still an issue with the latest version.