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 Geass-LL
Recipients Geass-LL, JelleZijlstra, shihai1991, sxt1001, vstinner
Date 2022-01-22.04:01:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1642824065.18.0.0591325640958.issue46454@roundup.psfhosted.org>
In-reply-to
Content
> File descriptors 0, 1, 2 are special: stdin, stdout and stderr file descriptors. You should use stdin, stdout, and stderr parameter of subprocess.

I finally find why `fd 0` is inherited. The reason is that os.dup2() has a parameter "inheritable" which defaults to True. Not because it's special stdin.

I still think this is a bug. If some one closes fd 0, then he reopens it. it will not be inherited.
History
Date User Action Args
2022-01-22 04:01:05Geass-LLsetrecipients: + Geass-LL, vstinner, JelleZijlstra, shihai1991, sxt1001
2022-01-22 04:01:05Geass-LLsetmessageid: <1642824065.18.0.0591325640958.issue46454@roundup.psfhosted.org>
2022-01-22 04:01:05Geass-LLlinkissue46454 messages
2022-01-22 04:01:05Geass-LLcreate