licunlong <shenxiao...@163.com> added the comment:

> 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.

----------

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

Reply via email to