Fix the compressed BLFWriter#1379
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #1379 +/- ##
===========================================
+ Coverage 66.21% 66.22% +0.01%
===========================================
Files 86 86
Lines 9021 9027 +6
===========================================
+ Hits 5973 5978 +5
- Misses 3048 3049 +1 |
| filesize = self.file.tell() | ||
| # Write header in the beginning of the file | ||
| self.file.seek(0) | ||
| self._write_header(filesize) |
There was a problem hiding this comment.
@zariiii9003 The call self.file.seek(0) results in an OSError. It appears that the code block is not required if write mode wb is used (rather than ab). However, if the append option is requested, then some of this idea may be required.
There was a problem hiding this comment.
The header contains things that are only known after the log has been written, so that's why we need to go back and write it later. Previously we closed and reopened the file to update it, but it seemed unnecessary if it was possible to seek instead.
|
Remaining tasks:
|
| filesize = ( | ||
| self.file.tell() | ||
| ) # == self.file.seek(0, 1) if type == gzip.GzipFile | ||
| if type(self.file) != gzip.GzipFile: | ||
| # Write header in the beginning of the file | ||
| self.file.seek(0) |
There was a problem hiding this comment.
If the type of self.file is a gzip.GzipFile, then the self.file.tell() call appears to enter gzip.seek(0, 1). Does it need to be called twice?
|
The current changes make it so that |
closes #1378