-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
no flush()
on PipedGzipWriter
#8
Comments
It’s actually not that easy. The only method I can think of would be to close the output file (which will flush everything implicitly) and then to re-open it in append mode. This would work since gzip files are allowed to be concatenated, but the problem is that the resulting file will not be the same as when At the moment, I tend to just leave it as it is. I’d accept a PR, but then probably the method would need to be called |
Thanks for the context, I wasn't aware of the details behind, and just (blindly) assumed the |
Thanks a lot for taking the time to write a detailed reply! I appreciate a lot learning which use cases exist. I think one other option is to allow to specify that |
As far as I know we have solved this issue. Using Furthermore the threaded option included in #131 does also allow the flush method. So eventually it will also become available for gzip threads. |
Currently flush does nothing: Line 398 in d98ee23
What can be done for writing is that the EOF is given to the program. It will then terminate the compression block. The file can be opened again in append mode and then the writing can resume. This only works for things that support concatenated blocks though, such as gzip. I think xz, zst and bzip2 also support those? But that would need more investigation. |
xz, zst and bzip2 also support mutiple compressed members in one file. |
It looks like the file-like object returned by
xopen()
for Gzip compressed files misses theflush()
method.AttributeError: 'PipedGzipWriter' object has no attribute 'flush'
This would be very helpful to have, as well as easy to implement, as
gzip.open
's file-like object supports theflush()
operation.The text was updated successfully, but these errors were encountered: