smartfile/python-libarchive

Returning b'' instead of None when reaching EOF

Opened this issue · 0 comments

Bubu commented

As discussed with the maintainer of ijson over here it seems that the archive stream reader should be returning b'' instead of None when finished reading.

your file-object from libarchive is "weird" in the sense that when it gets to the endof the file it implicitly returns None instead of an empty string (here and here). File-like objects are expected to return an empty string ('' or b'', depending on the mode with which it operates) when the end of the file is reached. This is the behavior that ijson expects as well

Would that be something that can be fixed for future versions?