← All recipes
Moderne licensed

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

Recipe IDorg.openrewrite.python.migrate.ReplacePlatformPopenArtifactopenrewrite-migrate-python

platform.popen() was removed in Python 3.8. Use subprocess.check_output(cmd, shell=True) instead. Note: this rewrites call sites but does not manage imports.

Single recipepythonmigration3.8platformProprietary

Usage

This recipe has no required configuration options. You’ll need the Moderne CLI configured before running the command below.

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

If the recipe isn’t available locally, install it with:

mod config recipes pip install openrewrite-migrate-python