can it? I though the fd needs to remain open as long as you are using the memmap. It should get closed somewhere though you're right - perhaps I could use open() instead of os.open() (and then .fileno to get the fd) which should give a file object that'l get closed when it goes out of scope.