darkdragn / lz4tools

LZ4Frame Bindings and tools for Python
90 stars 30 forks source link

Linewise iterate compressed file #16

Open dreamflasher opened 7 years ago

dreamflasher commented 7 years ago

With gzip.open() the following is possible:

with gzip.open(filename, 'rb') as f:
    for line in f:

How do I achieve this with lz4tools?

lz4tools.open(filename).read()

fails with RecursionError: maximum recursion depth exceeded in comparison -- I assume because it tries to load everything into memory and doesn't return a generator?