darkdragn / lz4tools

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

Lz4File.read() shouldn't throw EOFError #15

Closed dnuffer closed 7 years ago

dnuffer commented 8 years ago

The standard file objects in python return an empty string when EOF is reached. See https://docs.python.org/2/tutorial/inputoutput.html#methods-of-file-objects. "If the end of the file has been reached, f.read() will return an empty string ("")." Throwing an exception makes it so that a Lz4File can't be substituted for a regular file.

guoxiaoyong commented 7 years ago

Agreed.