In [17]: lz4.frame.open(input_file, mode='rt', newline='', encoding='utf-8')
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-17-ca68d3c17eba> in <module>()
----> 1 lz4.frame.open(input_file, mode='rt', newline='', encoding='utf-8')
/usr/local/lib/python3.6/site-packages/lz4/frame/__init__.py in open(filename, mode, encoding, errors, newline, block_size, block_linked, compression_level, content_checksum, block_checksum, auto_flush, return_bytearray, source_size)
842 block_checksum=block_checksum,
843 auto_flush=auto_flush,
--> 844 return_bytearray=return_bytearray,
845 )
846
/usr/local/lib/python3.6/site-packages/lz4/frame/__init__.py in __init__(self, filename, mode, block_size, block_linked, compression_level, content_checksum, block_checksum, auto_flush, return_bytearray, source_size)
513 self._pos = 0
514 else:
--> 515 raise ValueError('Invalid mode: {!r}'.format(mode))
516
517 if sys.version_info > (3, 6):
ValueError: Invalid mode: 'rt'
open() is happy with a mode of 'rt' and it passes it along unchanged to the LZ4FrameFile class which does not like 'rt'. Perhaps the mode should be changed to 'rb' when passing to the init method, or perhaps the init method should be happy with 'rt'.
Either way it breaks.
Looking at the source, it looks like mode is passed from
python-lz4/lz4/frame/__init__.py
Line 837 in 603c112
python-lz4/lz4/frame/__init__.py
Line 500 in 603c112
open() is happy with a mode of 'rt' and it passes it along unchanged to the LZ4FrameFile class which does not like 'rt'. Perhaps the mode should be changed to 'rb' when passing to the init method, or perhaps the init method should be happy with 'rt'.
Either way it breaks.