Open ijacquez opened 9 years ago
I managed to read 7z files in chunks.
@fancycode if you have any interest in this let me know, I can wrap it up in a method and do a pull request. It could potentially solve this issue.
@victor3rc, what were the results with files exceeding 4GiB?
@victor3rc sure, pull requests are always welcome!
@victor3rc I'm highly interesting by that code which read 7z files in chunks. It makes little sense for the ArchiveFile class to have a single read method which reads the whole file in memory.
@remyroy I agree.
@ijacquez I've been doing some tests with a 50+ GB file and it is reading it in chunks fine.
I'll try to wrap it in a method this week guys.
Hey @remyroy @ijacquez, just an update: I managed to read chunks but I was getting some errors when I was calling pylzma.decompressobj.decompress(chunk)
, specifically at the end of the file, on the final chunks.
A temporary solution I have found to the problem is to use subprocess
to call 7z
and decompress the file locally. I then read whatever is decompressed in chunks.
Do you have an idea as to what is causing that? Is it your changes? Are the chunks too big?
no idea, sorry. I didn't have time to look into the pylzma.decompressobj.decompress
functionality, that's where the error was happening. It wouldn't be the size of the chunks, that method is used to read the entire file.
@victor3rc , could you post your chunk reading code? even if it didn't fully work?
Decompressing large .7z files (> 4GiB) causes Python to raise MemoryError exception: