This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rfm
Recipients christian.heimes, docs@python, neologix, rfm, vstinner
Date 2013-10-30.09:45:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1383126336.73.0.264345539996.issue19444@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2013-10-30 09:45:36rfmsetrecipients: + rfm, vstinner, christian.heimes, neologix, docs@python
2013-10-30 09:45:36rfmsetmessageid: <1383126336.73.0.264345539996.issue19444@psf.upfronthosting.co.za>
2013-10-30 09:45:36rfmlinkissue19444 messages
2013-10-30 09:45:36rfmcreate