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 gregory.p.smith
Recipients cvrebert, ezio.melotti, gregory.p.smith, pitrou, rosslagerwall, sarum9in
Date 2012-08-29.18:21:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Here's my initial fix.

If fcntl(errpipe_write, F_DUPFD, 3) is widely available this could be shrunk a bit to avoid the for loop potentially calling dup a few times and tracking the wasted fds to close later.

Otherwise if it isn't I'd rather not bother with F_DUPFD as this code takes the optimal path when F_DUPFD_CLOEXEC is supported (true on all modern linux systems) and should cause no harm beyond a couple extra dup and close syscalls otherwise.

Note: Linux pipe2() support appears in kernels a few revisions after F_DUPFD_CLOEXEC support so the good behavior when pipe2 exists will be kept in this situation as that also means F_DUPFD_CLOEXEC support should exist.  The code will work regardless of that (incase someone has a frankenkernel, or other OSes choose to implement one but not the other).
Date User Action Args
2012-08-29 18:21:12gregory.p.smithsetrecipients: + gregory.p.smith, pitrou, ezio.melotti, cvrebert, rosslagerwall, sarum9in
2012-08-29 18:21:12gregory.p.smithsetmessageid: <>
2012-08-29 18:21:11gregory.p.smithlinkissue15798 messages
2012-08-29 18:21:10gregory.p.smithcreate