-
-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soft deprecate os.spawn*(), os.popen() and os.system() functions #120743
Comments
|
Links:
|
Soft deprecate os.popen(), os.spawn*() and os.system() functions.
|
Reminder: https://docs.python.org/dev/glossary.html#term-soft-deprecated
|
|
As a soft-deprecation with docs only, no warning raised, and no planned removal... I like this for all of the listed APIs. Including the widely used |
Could we do that as soon as possible? For a pattern issue, the We have a note suggesting subprocess use, but it doesn't mention the deprecation state. So, what do you guys think about:
|
Soft deprecate os.popen() and os.spawn*() functions.
|
Implemented as the change d44c550. |
I don't think that we have to be more aggressive about deprecating these functions. A soft deprecation mention at the end of the doc should be enough for now. |
|
On Windows, bear in mind that sharing file descriptors with a child process is non-obvious if you're not using |
On Windows, I prefer to pass handles to child processes :-) https://docs.python.org/dev/library/subprocess.html#subprocess.STARTUPINFO.lpAttributeList |
If one's current workflow is based around file descriptors, then switching from Even from Python script to a child Python script, we have nothing implemented to make this workflow obvious and simple.
|
Soft deprecate os.popen() and os.spawn*() functions.
Soft deprecate os.popen() and os.spawn*() functions.
Soft deprecate os.popen() and os.spawn*() functions.

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


See the discussion for the rationale: Is time to remove os module spawn* functions?
See also the discussion: How to deal with unsafe/broken os.spawn* arg handling behavior on Windows (Nov 2022).
Advantages of the subprocess module:
shell=Truemust be used explicitly.Examples of os functions issues:
shell=True, it cannot be disabled. (higher risk of shell code injection)Linked PRs
The text was updated successfully, but these errors were encountered: