Replace platform.popen() with subprocess.check_output()
Proprietaryplatform.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. ReplacePlatformPopenmod run . --recipe= org. openrewrite. python. migrate. ReplacePlatformPopenInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.