Migrate
Categories
Composite Recipes
Recipes that include further recipes, often including the individual recipes below.
- Upgrade to Python 3.10
- Upgrade to Python 3.11
- Upgrade to Python 3.12
- Upgrade to Python 3.13
- Upgrade to Python 3.14
- Upgrade to Python 3.8
- Upgrade to Python 3.9
Recipes
- Find deprecated
@asyncio.coroutinedecorator - Find deprecated
Element.getchildren()usage - Find deprecated
Path.link_to()usage - Find deprecated
aifcmodule usage - Find deprecated
audioopmodule usage - Find deprecated
cgimodule usage - Find deprecated
cgitbmodule usage - Find deprecated
chunkmodule usage - Find deprecated
cryptmodule usage - Find deprecated distutils module usage
- Find deprecated
imghdrmodule usage - Find deprecated imp module usage
- Find deprecated
locale.getdefaultlocale()usage - Find deprecated
mailcapmodule usage - Find deprecated
msilibmodule usage - Find deprecated
nismodule usage - Find deprecated
nntplibmodule usage - Find deprecated
os.popen()usage - Find deprecated
os.spawn*()usage - Find deprecated
ossaudiodevmodule usage - Find deprecated
pipesmodule usage - Find deprecated
re.template()/re.TEMPLATEusage - Find deprecated
shutil.rmtree(onerror=...)parameter - Find deprecated
sndhdrmodule usage - Find deprecated
spwdmodule usage - Find deprecated
ssl.match_hostname() - Find deprecated
sunaumodule usage - Find deprecated
sys.last_type/sys.last_value/sys.last_traceback - Find deprecated
telnetlibmodule usage - Find deprecated
tempfile.mktemp()usage - Find deprecated urllib.parse split functions
- Find deprecated
urllib.parse.to_bytes()usage - Find deprecated
uumodule usage - Find deprecated
xdrlibmodule usage - Find
functools.cmp_to_key()usage - Find modules removed in Python 3.12
- Find removed
HTMLParser.unescape()usage - Find removed
cgi.parse_qs()usage - Find removed
cgi.parse_qsl()usage - Find removed
macpathmodule usage - Find removed
platform.popen()usage - Find removed
sys.set_coroutine_wrapper()/sys.get_coroutine_wrapper() - Find removed
tarfile.filemodeusage - Find
socket.getfqdn()usage - Migrate
@asyncio.coroutinetoasync def - Replace
%formatting with f-string - Replace
Condition.notifyAll()withCondition.notify_all() - Replace
ConfigParser.readfp()withread_file() - Replace
Element.getiterator()withElement.iter() - Replace
Event.isSet()withEvent.is_set() - Replace
Thread.getName()withThread.name - Replace
Thread.isAlive()withThread.is_alive() - Replace
Thread.isDaemon()withThread.daemon - Replace
Thread.setDaemon()withThread.daemon = ... - Replace
Thread.setName()withThread.name = ... - Replace
array.fromstring()witharray.frombytes() - Replace
array.tostring()witharray.tobytes() - Replace
ast.Byteswithast.Constant - Replace
ast.Ellipsiswithast.Constant - Replace
ast.NameConstantwithast.Constant - Replace
ast.Numwithast.Constant - Replace
ast.Strwithast.Constant - Replace
base64.decodestring()withbase64.decodebytes() - Replace
base64.encodestring()withbase64.encodebytes() - Replace
cgi.escape()withhtml.escape() - Replace
collectionsABC imports withcollections.abc - Replace
configparser.SafeConfigParserwithConfigParser - Replace
datetime.utcfromtimestamp()withdatetime.fromtimestamp(ts, UTC) - Replace
datetime.utcnow()withdatetime.now(UTC) - Replace deprecated calendar constants with uppercase
- Replace deprecated distutils.version usage
- Replace deprecated gettext l*gettext() functions
- Replace deprecated unittest method aliases
- Replace
fractions.gcd()withmath.gcd() - Replace
imp.reload()withimportlib.reload() - Replace
import impwithimport importlib - Replace
inspect.getargspec()withinspect.getfullargspec() - Replace
locale.resetlocale()withlocale.setlocale(LC_ALL, '') - Replace
logging.warn()withlogging.warning() - Replace
pkgutil.find_loader()withimportlib.util.find_spec() - Replace
pkgutil.get_loader()withimportlib.util.find_spec() - Replace
str.format()with f-string - Replace
sys.getcheckinterval()withsys.getswitchinterval() - Replace
sys.setcheckinterval()withsys.setswitchinterval() - Replace
threading.activeCount()withthreading.active_count() - Replace
threading.currentThread()withthreading.current_thread() - Replace
time.clock()withtime.perf_counter() - Replace
typing.AbstractSetwithcollections.abc.Set - Replace
typing.AsyncContextManagerwithcontextlib.AbstractAsyncContextManager - Replace
typing.AsyncGeneratorwithcollections.abc.AsyncGenerator - Replace
typing.AsyncIterablewithcollections.abc.AsyncIterable - Replace
typing.AsyncIteratorwithcollections.abc.AsyncIterator - Replace
typing.Awaitablewithcollections.abc.Awaitable - Replace
typing.Callablewithcollections.abc.Callable - Replace
typing.ChainMapwithcollections.ChainMap - Replace
typing.Collectionwithcollections.abc.Collection - Replace
typing.Containerwithcollections.abc.Container - Replace
typing.ContextManagerwithcontextlib.AbstractContextManager - Replace
typing.Coroutinewithcollections.abc.Coroutine - Replace
typing.Counterwithcollections.Counter - Replace
typing.DefaultDictwithcollections.defaultdict - Replace
typing.Dequewithcollections.deque - Replace
typing.Dictwithdict - Replace
typing.Dictwithdict - Replace
typing.FrozenSetwithfrozenset - Replace
typing.Generatorwithcollections.abc.Generator - Replace
typing.ItemsViewwithcollections.abc.ItemsView - Replace
typing.Iterablewithcollections.abc.Iterable - Replace
typing.Iteratorwithcollections.abc.Iterator - Replace
typing.KeysViewwithcollections.abc.KeysView - Replace
typing.Listwithlist - Replace
typing.Listwithlist - Replace
typing.Mappingwithcollections.abc.Mapping - Replace
typing.MappingViewwithcollections.abc.MappingView - Replace
typing.Matchwithre.Match - Replace
typing.MutableMappingwithcollections.abc.MutableMapping - Replace
typing.MutableSequencewithcollections.abc.MutableSequence - Replace
typing.MutableSetwithcollections.abc.MutableSet - Replace
typing.Optional[X]withX | None - Replace
typing.OrderedDictwithcollections.OrderedDict - Replace
typing.Patternwithre.Pattern - Replace
typing.Reversiblewithcollections.abc.Reversible - Replace
typing.Sequencewithcollections.abc.Sequence - Replace
typing.Setwithset - Replace
typing.Setwithset - Replace
typing.Textwithstr - Replace
typing.Tuplewithtuple - Replace
typing.Tuplewithtuple - Replace
typing.Typewithtype - Replace
typing.Union[X, Y]withX | Y - Replace
typing.ValuesViewwithcollections.abc.ValuesView