Skip to content

Incorrect stream properties (TypeError) while trying to decompress #67

Open
@remyroy

Description

@remyroy

Hi,

I'm having an issue trying to decompress the following archive using pylzma.

This is on Windows 10 with pylzma 0.5.0.

Towards the end of the archive, I'm getting a TypeError exception in decompressor.decompress.

Traceback:

Traceback:
  File "C:\Users\Rémy Roy\Projects\CDDA-Game-Launcher\cddagl\ui.py", line 4966, in timeout
    f.write(extracting_element.read())
  File "C:\Users\RMYROY~1\VIRTUA~1\CDDA-G~3\lib\site-packages\py7zlib.py", line 632, in read
    data = getattr(self, decoder)(coder, data, level, num_coders)
  File "C:\Users\RMYROY~1\VIRTUA~1\CDDA-G~3\lib\site-packages\py7zlib.py", line 702, in _read_lzma
    return self._read_from_decompressor(coder, dec, input, level, num_coders, with_cache=True)
  File "C:\Users\RMYROY~1\VIRTUA~1\CDDA-G~3\lib\site-packages\py7zlib.py", line 686, in _read_from_decompressor
    data = decompressor.decompress(input, self._start+size)

This is the relevant code that does the decompression:

from py7zlib import Archive7z

class Dummy():

    def decompress():
        self.extracting_zipfile = open(self.downloaded_file, 'rb')
        self.extracting_archive = Archive7z(self.extracting_zipfile)
        self.extracting_infolist = self.extracting_archive.getmembers()

        self.extracting_index = 0

        while (self.extracting_index < len(self.extracting_infolist)):

            extracting_element = self.extracting_infolist[
                self.extracting_index]
            destination = os.path.join(self.extract_dir,
                *extracting_element.filename.split('/'))
            dest_dir = os.path.dirname(destination)
            if not os.path.isdir(dest_dir):
                os.makedirs(dest_dir)
            with open(destination, 'wb') as f:
                f.write(extracting_element.read())
            self.extracting_index += 1

The real code that does the decompression can be found here.

Here is more information about that archive:

file-info

This seems related to #56 and maybe to what @victor3rc was talking in #32.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions