You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
mmap.size() raises OSError on Unix for anonymous memory #87595
The question is whether this should be classified as a bug fix or a new feature. It seems that mmap.size() never worked for anonymous mapping on Unix, so there is no user code that depends on it. Although this limitation was not documented.
There are now two PRs, #24781 and #138198. The former adds this as a new feature and has more documentation, the latter treat it as a bug fix and takes into account trackfd.
I think we should go with #24781, after it was updated.
Also, it was decided in the discussion for #138238 that it is better to raise a dedicated error for trackfd=False instead of triggering an OSError by passing invalid handler or descriptor to the OS API.
Activity
ZackerySpytz commentedon Mar 7, 2021
For anonymous memory, mmap.size() works without issue on Windows, but it raises OSError on Unix.
serhiy-storchaka commentedon Aug 29, 2025
The question is whether this should be classified as a bug fix or a new feature. It seems that mmap.size() never worked for anonymous mapping on Unix, so there is no user code that depends on it. Although this limitation was not documented.
There are now two PRs, #24781 and #138198. The former adds this as a new feature and has more documentation, the latter treat it as a bug fix and takes into account
trackfd.I think we should go with #24781, after it was updated.
gh-87595: Support mmap.size() for anonymous mapping on Unix (GH-24781)
pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…
pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…
serhiy-storchaka commentedon Sep 2, 2025
Also, it was decided in the discussion for #138238 that it is better to raise a dedicated error for trackfd=False instead of triggering an OSError by passing invalid handler or descriptor to the OS API.
pythongh-87595: Fix the docs for mmap.size()
gh-87595: Fix the docs for mmap.size() (#138494)
pythongh-87595: Support mmap.size() for anonymous mapping on Unix (py…
pythongh-87595: Fix the docs for mmap.size() (python#138494)