-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
Add seekable
method for mmap.mmap
#111835
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
Comments
seekable
method for mmap.mmap
|
I also opened a PR #111865 for this, I just took a while between pushing the code and opening the PR. |
Yeah, in that case, we can make a seek() method to return where value. It will break the user's code actually? |
#111852 is landed, this feature will be available from CPython 3.13 @serhiy-storchaka @vstinner |
Bug report
Bug description:
mmap.mmap
has aseek()
method, but noseekable()
method. Because of this, it cannot be used an argument for ZipFile, which requires a file-like object with seekable. A small patch is enough to fix thisNow SeekableMmap can be passed to ZipFile without issue. It's easy to fix, but I can't think of any reasons why mmap shouldn't have a seekable method.
CPython versions tested on:
3.8, 3.11
Operating systems tested on:
Linux
Linked PRs
The text was updated successfully, but these errors were encountered: