diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2010-12-04 09:10:44 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2010-12-04 09:10:44 (GMT) |
commit | d23047b62c6f885def9020bd9b304110f9b9c52d (patch) | |
tree | 4adeb352a619ce0ce869f93ea792d6ab8403ee64 /Doc | |
parent | 35f08f0f844186f3a3f3a4dd477ea22d589886de (diff) | |
download | cpython-d23047b62c6f885def9020bd9b304110f9b9c52d.zip cpython-d23047b62c6f885def9020bd9b304110f9b9c52d.tar.gz cpython-d23047b62c6f885def9020bd9b304110f9b9c52d.tar.bz2 |
issue7213 + issue2320: Cause a DeprecationWarning if the close_fds argument is
not passed to subprocess.Popen as the default value will be changing in a
future Python to the safer and more often desired value of True.
DeprecationWarnings that show up in a lot of existing code are controversial
and have caused pain in the past. I'd like to leave this on for 3.2 beta1 and
see how things go. We can remove the warning if it is deemed too noisy during
any betas. (case study: the md5 and sha module DeprecationWarnings are loathed
around the world as those modules were never going to be removed in 2.x and
2to3 has a fixer for code that uses them)
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/subprocess.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/library/subprocess.rst b/Doc/library/subprocess.rst index e0bb163..a346d98 100644 --- a/Doc/library/subprocess.rst +++ b/Doc/library/subprocess.rst @@ -153,10 +153,15 @@ This module defines one class called :class:`Popen`: If *close_fds* is true, all file descriptors except :const:`0`, :const:`1` and :const:`2` will be closed before the child process is executed. (Unix only). - Or, on Windows, if *close_fds* is true then no handles will be inherited by the + The recommended value for this argument is True. + On Windows, if *close_fds* is true then no handles will be inherited by the child process. Note that on Windows, you cannot set *close_fds* to true and also redirect the standard handles by setting *stdin*, *stdout* or *stderr*. +.. versionchanged:: 3.2 + Callers should always specify a *close_fds* to avoid a DeprecationWarning. + The default value for this argument will be changing in Python 3.3. + If *shell* is :const:`True`, the specified command will be executed through the shell. |