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
gzip.GzipFile to accept stream as fileobj. #40026
Comments
When gzip.GzipFile is initialized with a fileobj which But keep in mind that seek() and rewind() methond of Igor |
Logged In: YES Previous revision of the patch does not work correctly with |
Logged In: YES I thought I need to add a little bit more verbose Current implementation of GzipFile() uses tell() and seek()
What my change does it introduces 2 helper buffers: Plus, my change introduces helper method _read_internal() When case 1 above happen we use 'last8' buffer to read There's one more instance of the self.fileobj.seek() call Igor |
1 similar comment
Logged In: YES I thought I need to add a little bit more verbose Current implementation of GzipFile() uses tell() and seek()
What my change does it introduces 2 helper buffers: Plus, my change introduces helper method _read_internal() When case 1 above happen we use 'last8' buffer to read There's one more instance of the self.fileobj.seek() call Igor |
Logged In: YES Is there any reson this patch is not accepted? If this patch |
The patch in this form is incomplete: it lacks test suite changes. Can somebody please provide patches to Lib/test/test_gzip.py that exercises this new functionality? |
It looks like Patch bpo-1675951 provides the same feature, plus speedups. |
There's a problem with this path. If previously in my code I read some bytes of the the GzipFile object, _read_gzip_header returns IOError, 'Not a gzipped file', because it starts to read at the current position, not at the start. Unluckily seek() could not be used for urllib objects. I don't see any possible workaround. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: