-
-
Notifications
You must be signed in to change notification settings - Fork 33k
gh-87595: mmap.size() now returns the size on Unix for anonymous memory #24781
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
gh-87595: mmap.size() now returns the size on Unix for anonymous memory #24781
Conversation
Previously, the size would be returned on Windows and an OSError would be raised on Unix.
This PR is stale because it has been open for 30 days with no activity. |
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.
LGTM. @ZackerySpytz Could you resolve the conflicts?
Marking as needs backport to 3.11 because the parent issue is marked as
type-bug
|
@ZackerySpytz, could you please update your PR to 3.15? It should take into account |
I'm not sure that @ZackerySpytz is still active. Maybe a new PR should be written? |
Thanks @ZackerySpytz for the PR, and @serhiy-storchaka for merging it 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14. |
…thonGH-24781) Previously, the size would be returned on Windows and an OSError would be raised on Unix. Also, raise ValueError instead of OSError for trackfd=False. (cherry picked from commit 32032ee) Co-authored-by: Zackery Spytz <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
…thonGH-24781) Previously, the size would be returned on Windows and an OSError would be raised on Unix. Also, raise ValueError instead of OSError for trackfd=False. (cherry picked from commit 32032ee) Co-authored-by: Zackery Spytz <[email protected]> Co-authored-by: Serhiy Storchaka <[email protected]>
GH-138404 is a backport of this pull request to the 3.14 branch. |
GH-138405 is a backport of this pull request to the 3.13 branch. |
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.
Hello, @serhiy-storchaka. We must modify some of the changes you have made to this PR.
|
||
Return the length of the file, which can be larger than the size of the | ||
memory-mapped area. | ||
For anonymous mapping, return its size. |
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.
For anonymous mapping, return its size. | |
For an anonymous mapping, return its size. |
For anonymous mapping, return its size. | ||
|
||
.. versionchanged:: next | ||
Supports anonymous mapping on Unix. |
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.
Supports anonymous mapping on Unix. | |
Anonymous mappings are now supported on Unix. |
would be raised on Unix. | ||
Raise :exc:`ValueError` instead of :exc:`OSError` with ``trackfd=False``. |
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.
would be raised on Unix. | |
Raise :exc:`ValueError` instead of :exc:`OSError` with ``trackfd=False``. | |
would be raised on Unix. :exc:`ValueError` is now raised instead of | |
:exc:`OSError` when ``trackfd=False``. |
@ZackerySpytz this has been merged, please would you open a new PR? |
I'm well aware that this PR has been merged, thank you very much. |
@serhiy-storchaka I have created GH-138494. |
…thonGH-24781) Previously, the size would be returned on Windows and an OSError would be raised on Unix. Also, raise ValueError instead of OSError for trackfd=False. Co-authored-by: Serhiy Storchaka <[email protected]>
Previously, the size would be returned on Windows and an OSError would
be raised on Unix.
https://bugs.python.org/issue43429