Repository navigation
os.system not marked as deprecated #157882
Description
Activity
I would regret for os.system() to be deprecated. I would be happy for it to be implemented on top of subprocess. Ditto for os.popen().
Those functions are not meant to be deprecated but carefully used.
#120743 proposed to soft deprecate
os.spawn*(),os.popen()andos.system(), but the PR droppedos.systemand only did the other two: #120744 (comment).the documentation for the
osmodule does not report on the deprecation ofos.system, it is documented at thesubprocessmodule and reported by type checkers.I don't see any mention of soft deprecation at the
subprocessmodule?Which type checkers are reporting it as soft deprecated? Sounds like a bug report for them.
Which type checkers are reporting it as soft deprecated? Sounds like a bug report for them.
I wouldn't blame the type checkers. Typeshed has:
@deprecated("Soft deprecated. Use the subprocess module instead.") def system(command: StrOrBytesPath) -> int: ...Added in python/typeshed#15179, which referenced the PR I mentioned above: #120744.
Confusion possibly triggered by the PR that mentioned
os.systemin the description, and in its issue title.I've opened python/typeshed#16421 to fix Typeshed.
I think it would be a shame to deprecate (and hence, likely eventually remove)
os.system. Python is a great language for quick and dirty scripting, and for those use cases, a simple "just run the command" thing is great.Don't worry! There was no suggestion to do a normal deprecation or remove
os.system, that would be far too disruptive.The proposal was to "soft deprecate", which means we would have recommended something else in the docs, but not plan to remove, and not issue any deprecation warnings.
Reacted by Akuli
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsTodo
Documentation
the documentation for the
osmodule does not report on the deprecation ofos.system, it is documented at thesubprocessmodule and reported by type checkers.The docs describe
os.systemas soft-deprecated in prose, but it is not formally marked as soft deprecated.