Robert Merrill added the comment:

I'm adding Library again because I think the current behavior is a bug and 
should be fixed in the 2.7 tree. Perhaps the documentation in older versions 
should be updated 

mmap.mmap should always set the FD_CLOEXEC flag on the descriptor that it gets 
from dup(). I don't see why we wouldn't do this, because if we are calling 
exec(), we are blowing away all python state, and only the mmap object should 
be using this file descriptor (since its existence is hidden from the user).

Users should not be depending on the old behavior, because the interface which 
is presented to them gives them no indication that this fd even exists. Users 
are probably expecting the proposed behavior, because anyone who has worked 
with unix file descriptors in C would not expect:

fd = os.open(...)
mmap = mmap.mmap(fd, size)
# do some stuff
os.close(fd)

To result in an extra inheritable fd still being there. Nothing in the 
documentation indicates that this would happen, either.

----------
components: +Library (Lib)
versions:  -Python 3.4

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue19444>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to