We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
There are several issues on this tracker discussing python-zstandard's approach to .seek, summarised by this comment: #216 (comment)
.seek
But it sounds like python-zstandard is still happy with forward seeks. If so, we should return True from seekable, so that e.g. we can forward seek through io.BufferedReader: https://github.com/python/cpython/blob/dd0a1f9da283bd784e2c88efec0a45cef978516a/Modules/_io/bufferedio.c#L1227
return True
seekable
io.BufferedReader
Here's a small repro:
import zstandard fn = "whatever.zst" unbuffered = zstandard.open(fn) unbuffered.seek(10) unbuffered.read(10) # works fine buffered = io.BufferedReader(zstandard.open(fn)) buffered.seek(10) # fails # UnsupportedOperation: File or stream is not seekable.
It's useful to wrap with BufferedReader to get functionality like readline (I noticed you recommended doing this here as well :-) #13 (comment) )
readline
The text was updated successfully, but these errors were encountered:
No branches or pull requests
There are several issues on this tracker discussing python-zstandard's approach to
.seek
, summarised by this comment: #216 (comment)But it sounds like python-zstandard is still happy with forward seeks. If so, we should
return True
fromseekable
, so that e.g. we can forward seek throughio.BufferedReader
: https://github.com/python/cpython/blob/dd0a1f9da283bd784e2c88efec0a45cef978516a/Modules/_io/bufferedio.c#L1227Here's a small repro:
It's useful to wrap with BufferedReader to get functionality like
readline
(I noticed you recommended doing this here as well :-) #13 (comment) )The text was updated successfully, but these errors were encountered: