c.compress(data) # On decompression, too large input will raise LZ4StreamError with pytest.raises(lz4.stream.LZ4StreamError): > with lz4.stream.LZ4StreamDecompressor(**kwargs) as proc: data = <[MemoryError() raised in repr()] bytes object at 0x2016ae3010> kwargs = {'buffer_size': 2113929216, 'dictionary': b'', 'store_comp_size': 4, 'strategy': 'double_buffer'} message = '^Input too large for LZ4 API$' proc = tests/stream/test_stream_2.py:104: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = strategy = 'double_buffer', buffer_size = 2113929216, return_bytearray = 0 store_comp_size = 4, dictionary = b'' def __init__(self, strategy, buffer_size, return_bytearray=False, store_comp_size=4, dictionary=""): """ Instantiates and initializes a LZ4 stream decompression context. Args: strategy (str): Buffer management strategy. Can be: ``double_buffer``. buffer_size (int): Size of one buffer of the double-buffer used internally for stream decompression in the case of ``double_buffer`` strategy. Keyword Args: return_bytearray (bool): If ``False`` (the default) then the function will return a ``bytes`` object. If ``True``, then the function will return a ``bytearray`` object. store_comp_size (int): Specify the size in bytes of the following compressed block. Can be: ``1``, ``2`` or ``4`` (default: ``4``). dictionary (str, bytes or buffer-compatible object): If specified, perform decompression using this initial dictionary. Raises: Exceptions occuring during the context initialization. OverflowError: raised if the ``dictionary`` parameter is too large for the LZ4 context. ValueError: raised if some parameters are invalid. MemoryError: raised if some internal resources cannot be allocated. RuntimeError: raised if some internal resources cannot be initialized. """ return_bytearray = 1 if return_bytearray else 0 > self._context = _create_context(strategy, "decompress", buffer_size, return_bytearray=return_bytearray, store_comp_size=store_comp_size, dictionary=dictionary) E MemoryError: Could not allocate output buffer buffer_size = 2113929216 dictionary = b'' return_bytearray = 0 self = store_comp_size = 4 strategy = 'double_buffer' lz4/stream/__init__.py:45: MemoryError =========================== short test summary info ============================ FAILED tests/stream/test_stream_2.py::test_huge_2 - MemoryError: Could not al... !!!!!!!!!!!!!!!!!!!!!!!!!! stopping after 1 failures !!!!!!!!!!!!!!!!!!!!!!!!!!! ========= 1 failed, 69436 passed, 17363 skipped in 16712.78s (4:38:32) ========= BUILDSTDERR: error: Bad exit status from /var/tmp/rpm-tmp.NUuwZj (%check) RPM build errors: BUILDSTDERR: Bad exit status from /var/tmp/rpm-tmp.NUuwZj (%check) Child return code was: 1 EXCEPTION: [Error()] Traceback (most recent call last): File "/usr/lib/python3.7/site-packages/mockbuild/trace_decorator.py", line 96, in trace result = func(*args, **kw) File "/usr/lib/python3.7/site-packages/mockbuild/util.py", line 636, in do raise exception.Error("Command failed: \n # %s\n%s" % (command, output), child.returncode) mockbuild.exception.Error: Command failed: # bash --login -c /usr/bin/rpmbuild -bb --target riscv64 --nodeps /builddir/build/SPECS/python-lz4.spec