[issue12556] Disable size checks in mmap.mmap()
Charles-François Natali
report at bugs.python.org
Fri Jul 15 19:34:13 CEST 2011
Charles-François Natali <neologix at free.fr> added the comment:
A couple remarks:
- if st_size == 0, then you have to specify an explicit length (your example passes 0, which would fail with EINVAL without the check)
- most enties in /proc don't support mmap file operation, so it's likely to fail anyway (with ENODEV, EACCESS...). Do you have an example of a /proc entry with st_size == 0 that can be mmapped (mapping /proc/sys/debug/exception-trace fails with EACCESS)?
> How about adding a keyword argument to `mmap.mmap()`, which disables
> fstat-based size checks?
I don't like the idea of adding an argument which doesn't have a counterpart in the POSIX version (especially to address such corner cases).
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue12556>
_______________________________________
More information about the Python-bugs-list
mailing list