Message322953
mmap.mmap(fileno, length, flags, prot, access, offset) always clones the file descriptor that should be used [1].
The cloning of the file descriptor seems to be done to ensure that the file cannot be closed behind mmap's back, but if you are mmap()'ing a lot of memory regions of a file this can cause a 'Too many open files' error.
I would suggest to add an option to mmap.mmap() that tells it not to clone the file descriptor. This can cause an issue if the file is closed before accessing the mmapped region, so this fact should also be pointed out in the documentation.
[1] https://github.com/python/cpython/blob/master/Modules/mmapmodule.c#L1159 |
|
Date |
User |
Action |
Args |
2018-08-02 13:22:03 | manuels | set | recipients:
+ manuels |
2018-08-02 13:22:03 | manuels | set | messageid: <1533216123.68.0.56676864532.issue34321@psf.upfronthosting.co.za> |
2018-08-02 13:22:03 | manuels | link | issue34321 messages |
2018-08-02 13:22:03 | manuels | create | |
|