Replace platform.popen() with subprocess.check_output()

Proprietary

platform.popen() was removed in Python 3.8. Use subprocess.check_output(cmd, shell=True) instead. Only the single-argument form is rewritten, since mode and bufsize have no check_output equivalent. The result is bytes rather than a file object, and a non-zero exit status raises CalledProcessError, so code using it needs adjusting by hand.

org.openrewrite.python.migrate.ReplacePlatformPopen
mod run . --recipe=org.openrewrite.python.migrate.ReplacePlatformPopen

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.