Ravencentric / archivefile

Unified interface for tar, zip, sevenzip, and rar files
https://archivefile.ravencentric.cc/
The Unlicense
13 stars 0 forks source link

fix: improve read_bytes/text methods #3

Closed Ravencentric closed 1 month ago

Ravencentric commented 1 month ago

Closes https://github.com/Ravencentric/archivefile/issues/2

This PR redoes the ArchiveFile.read_* methods to use each handler's respective read method. Also handles EOF case in select py7zr methods by using .reset().

For reference, I'm talking about this:

Once extract() called, the SevenZipFile object become exhausted, and an EOF state. If you want to call read(), readall(), extract(), extractall() again, you should call reset() before it.

https://py7zr.readthedocs.io/en/latest/api.html#py7zr.SevenZipFile.extract

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 100.00%. Comparing base (d2d7ff9) to head (9ef7588).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #3 +/- ## ========================================= Coverage 100.00% 100.00% ========================================= Files 7 7 Lines 348 361 +13 ========================================= + Hits 348 361 +13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.