-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-78502: Add a trackfd parameter to mmap.mmap() #25425
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
Merged
encukou
merged 16 commits into
python:main
from
ZackerySpytz:bpo-34321-mmap-trackfd-parameter
Jan 16, 2024
Merged
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
d42762c
bpo-34321: Add a trackfd parameter to mmap.mmap()
ZackerySpytz 8d141ad
Merge branch 'main' into bpo-34321-mmap-trackfd-parameter
erlend-aasland 12705a6
Merge in the main branch
encukou 42302bc
Make the trackfd argument keyword-only
encukou 9443f1f
Add smoke tests for a mmap with trackfd=False
encukou eb8d798
Update documentation
encukou 8f05c7b
Make resize() fail with trackfd=False
encukou b207558
Test with original fd closed after creating mmap
encukou 7607593
Document trackfd as keyword-only
encukou 2d90229
Update docstring
encukou 0a717f8
Test with fd=-1, and that this fails on Windows
encukou 7364a27
Test the errno
encukou eca802c
Move the What's New entry to 3.13
encukou 51bb4e5
Raise ValueEror on resize
encukou d274952
Fix Sphinx warning
encukou e33a7fd
Note why you might want to use this
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Test with fd=-1, and that this fails on Windows
- Loading branch information
commit 0a717f8d6aad1a44dc9dd85c301e8a91c1e6418e
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it work the same for
mmap(-1, size, trackfd=True)? I have not found tests for this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trackfd=Trueis the default. It's tested intest_resize_past_pos.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has different behavior. Should
trackfd=Falsehave any effect forfd=-1? Should combinationfd=-1andtrackfd=Falsebe allowed?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Conceptually,
trackfd=Falseshould be the only possible behaviour forfd=-1-- the fd is not tracked.However, I don't think it's worth it to include a third value for “trackfd=default”. As it is, the default (
True) works as before. SettingFalsehas the documented effect -- disablingresize. This isn't very useful, but I don't think it's worth handling specially.