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 izbyshev
Recipients benjamin.peterson, izbyshev, vstinner
Date 2018-02-17.03:24:01
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1518837842.39.0.467229070634.issue32862@psf.upfronthosting.co.za>
In-reply-to
Content
os.dup2(fd, fd, inheritable=False) may fail or change fd inheritability in following ways:

1) POSIX without F_DUP2FD_CLOEXEC
1.1) dup3() is available (a common case for Linux): OSError (EINVAL, dup3() doesn't allow equal descriptors)
1.2) dup3() is not available: fd made non-inheritable

2) POSIX with F_DUP2FD_CLOEXEC (FreeBSD): inheritability is not changed

3) Windows: fd made non-inheritable

In contrast, os.dup2(fd, fd, inheritable=True) never changes fd inheritability (same as before PEP 446 landed). I suggest to make os.dup2(fd, fd, inheritable=False) behave the same.
History
Date User Action Args
2018-02-17 03:24:02izbyshevsetrecipients: + izbyshev, vstinner, benjamin.peterson
2018-02-17 03:24:02izbyshevsetmessageid: <1518837842.39.0.467229070634.issue32862@psf.upfronthosting.co.za>
2018-02-17 03:24:02izbyshevlinkissue32862 messages
2018-02-17 03:24:01izbyshevcreate