marking os.system() as deprecated in the docs
Hello, I'd like to propose formally marking os.system() as deprecated in the docs for next release of Python (v3.2 ?). The docs for os.system() /already/ include the following paragraph, which is basically tantamount to calling system() deprecated and very much resembles the deprecation notes for the os.popen*() family. """ The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. Use the subprocess module. Check especially the Replacing Older Functions with the subprocess Module section. """ I'm merely suggesting slapping a formal ".. deprecated::" tag & box around this paragraph to make system()'s status more obvious. I am ***not*** suggesting the function be scheduled for removal or anything like that. I figure since this would be a substantive change (the docs currently don't outright say "deprecated"), it would need dev approval, hence this message. I've already written the absolutely /trivial/ docs patch. So, any objections? Cheers, Chris
Unless, it's as simple as replacing "os.system(x)" with "subprocess.system(x)", I'm against this removal of a handy shorthand. Ditto for popen. On Sun, Jul 25, 2010 at 11:42 PM, Chris Rebert <pydev@rebertia.com> wrote:
Hello,
I'd like to propose formally marking os.system() as deprecated in the docs for next release of Python (v3.2 ?).
The docs for os.system() /already/ include the following paragraph, which is basically tantamount to calling system() deprecated and very much resembles the deprecation notes for the os.popen*() family. """ The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. Use the subprocess module. Check especially the Replacing Older Functions with the subprocess Module section. """
I'm merely suggesting slapping a formal ".. deprecated::" tag & box around this paragraph to make system()'s status more obvious. I am ***not*** suggesting the function be scheduled for removal or anything like that.
I figure since this would be a substantive change (the docs currently don't outright say "deprecated"), it would need dev approval, hence this message. I've already written the absolutely /trivial/ docs patch.
So, any objections?
Cheers, Chris _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/guido%40python.org
-- --Guido van Rossum (python.org/~guido)
On Sun, Jul 25, 2010 at 11:42 PM, Chris Rebert <pydev@rebertia.com> wrote:
Hello,
I'd like to propose formally marking os.system() as deprecated in the docs for next release of Python (v3.2 ?).
The docs for os.system() /already/ include the following paragraph, which is basically tantamount to calling system() deprecated and very much resembles the deprecation notes for the os.popen*() family. """ The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. Use the subprocess module. Check especially the Replacing Older Functions with the subprocess Module section. """
Emphasizing the following paragraph from my original email:
I'm merely suggesting slapping a formal ".. deprecated::" tag & box around this paragraph to make system()'s status more obvious. I am ***not*** suggesting the function be scheduled for removal or anything like that.
I figure since this would be a substantive change (the docs currently don't outright say "deprecated"), it would need dev approval, hence this message. I've already written the absolutely /trivial/ docs patch.
So, any objections?
On Mon, Jul 26, 2010 at 7:29 AM, Guido van Rossum <guido@python.org> wrote:
Unless, it's as simple as replacing "os.system(x)" with "subprocess.system(x)", I'm against this removal of a handy shorthand.
[Addressing Steven's reply as well] In hindsight, I should have used a word other than "deprecate" (despite no longer matching the Sphinx directive) that's not overloaded with Python baggage about removal; I intended it here in its plain English meaning of merely "to express disapproval of" or "to play down". Allow me to reiterate: I am *NOT* suggesting os.system() be removed or prepared for removal. I'm only suggesting the docs be /slightly/ tweaked to make it /slightly/ more obvious that os.system() is dispreferred over the subprocess module. Removing os.system() would have backward compatibility and cross-language API problems; I agree it would be a bad idea; which is why I'm not proposing that.
Ditto for popen.
Funny you should bring up os.popen(). Its docs are currently MIA in 3.x, for unclear reasons: http://bugs.python.org/issue9382 Cheers, Chris
-- --Guido van Rossum (python.org/~guido)
Guido van Rossum wrote:
Unless, it's as simple as replacing "os.system(x)" with "subprocess.system(x)", I'm against this removal of a handy shorthand.
Also, seeing as it's a well-known C library facility, and Python likes to provide thin wrappers around the C library wherever reasonable, its lack would seem a bit odd. -- Greg
On Mon, 26 Jul 2010 04:42:06 pm Chris Rebert wrote:
Hello,
I'd like to propose formally marking os.system() as deprecated in the docs for next release of Python (v3.2 ?).
-0.5 on that. I often use os.system() for quick and dirty scripts that just call an external process without caring what the output is. But perhaps os.system() should become an alias for subprocess.system() in 3.2, then deprecated in 3.3 and removed (from os only) in 3.4? -- Steven D'Aprano
The current text is: The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. See the Replacing Older Functions with the subprocess Module section in the subprocess documentation for some helpful recipes. We could soften "using that module is preferable" to say "may be", or just delete that whole clause completely. --amk
Is it possible to use subprocess functionality in os.system()? Just exactly describe what it does instead of "This is implemented by calling the Standard C function system(), and has the same limitations." type sentences. -- anatoly t. On Mon, Jul 26, 2010 at 6:52 PM, A.M. Kuchling <amk@amk.ca> wrote:
The current text is:
The subprocess module provides more powerful facilities for spawning new processes and retrieving their results; using that module is preferable to using this function. See the Replacing Older Functions with the subprocess Module section in the subprocess documentation for some helpful recipes.
We could soften "using that module is preferable" to say "may be", or just delete that whole clause completely.
--amk _______________________________________________ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/techtonik%40gmail.com
participants (6)
-
A.M. Kuchling
-
anatoly techtonik
-
Chris Rebert
-
Greg Ewing
-
Guido van Rossum
-
Steven D'Aprano