Upgrade to Python 3.8
ProprietaryMigrate deprecated APIs and detect legacy patterns for Python 3.8 compatibility. cgi.escape() becomes html.escape(), with quote=False where the call relied on cgi.escape() leaving quotes alone.
org. openrewrite. python. migrate. UpgradeToPython38mod run . --recipe= org. openrewrite. python. migrate. UpgradeToPython38Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.
Recipe list
It runs these recipes, in this order.
- Change import
- Replace
cgi.escape()withhtml.escape() - Replace
cgi.parse_qs()withurllib.parse.parse_qs() - Replace
cgi.parse_qsl()withurllib.parse.parse_qsl() - Replace
platform.popen()withsubprocess.check_output() - Find removed
macpathmodule usage - Replace
tarfile.filemodewithstat.filemode - Find removed
sys.set_coroutine_wrapper()/sys.get_coroutine_wrapper() - Replace
str.format()with f-string - Replace
%formatting with f-string - Find
functools.cmp_to_key()usage - Remove obsolete
__future__imports - org.openrewrite.python.migrate.UpgradePythonVersionTo38