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. |
furkanonder
left a comment
There was a problem hiding this comment.
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 <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
…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 <zspytz@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
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. |
ZackerySpytz
left a comment
There was a problem hiding this comment.
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.
| 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.
| 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.
| 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 <storchaka@gmail.com>
Previously, the size would be returned on Windows and an OSError would
be raised on Unix.
https://bugs.python.org/issue43429