Upgrades and deprecations
Python 3.9 to 3.12: What Breaks at Each Release, and the Hop Order
In short
To upgrade Python 3.9 to 3.12 is to absorb three releases of removals at once: `distutils`, `imp`, `asyncore`, `asynchat` and `smtpd` are gone, old `unittest` aliases fail, and new virtual environments ship without setuptools. 3.9 reached end of life on 31 October 2025, and 3.12 itself takes security fixes only, scheduled to end in October 2028.
Where do 3.9 through 3.12 stand on the official status page today?
The Python devguide versions page splits branches into supported and unsupported. On 20 November 2026 it lists 3.9 and 3.10 as end of life, and 3.11, 3.12 and 3.13 as security-only. Dates marked with an asterisk on that page are scheduled and can move.
The policy behind the dates: a release takes bug fixes for two years (18 months for releases before 3.13), then security fixes only with no new binaries, and reaches end of life five years after its first release. So 3.12 has already left its bugfix phase.
| Branch | First release | End of life | Status on 20 Nov 2026 |
|---|---|---|---|
| 3.9 | 5 Oct 2020 | 31 Oct 2025 | End of life |
| 3.10 | 4 Oct 2021 | 1 Oct 2026 | End of life |
| 3.11 | 24 Oct 2022 | Oct 2027 (scheduled) | Security fixes only |
| 3.12 | 2 Oct 2023 | Oct 2028 (scheduled) | Security fixes only |
| 3.13 | 7 Oct 2024 | Oct 2029 (scheduled) | Security fixes only |
| 3.14 | 7 Oct 2025 | Oct 2030 (scheduled) | Bug fixes |
Checked against: source 1
Should I upgrade Python 3.9 to 3.12 in one jump or through 3.10 and 3.11?
Each What's New page explains changes against the release just before it, and removals usually follow a deprecation one or two releases earlier. distutils was deprecated in 3.10 and removed in 3.12. The 3.11 notes already list asynchat, asyncore and smtpd, plus SafeConfigParser and readfp(), as due for removal in 3.12.
That is the argument for hops. Running the test suite on 3.10 and then 3.11 shows those deprecation warnings while the old names still work, so each fix can land on its own. Jumping straight to 3.12 turns the same warnings into ImportError and AttributeError.
Deprecation warnings are hidden by the default filters. The Python Development Mode docs say -X dev (or PYTHONDEVMODE=1) adds a default warning filter that shows DeprecationWarning and PendingDeprecationWarning, as if -W default were passed. I would turn it on in the test run at 3.9 first, then at each hop.
What does 3.10 take away from 3.9 code?
These come from the Removed and Porting sections of the 3.10 notes. The first two are the most common in older code.
- The aliases to the abstract base classes in
collections, such ascollections.Mapping, are removed. Import them fromcollections.abc. - The
loopparameter is removed from most of the high-level asyncio API, soasyncio.sleep(1, loop=loop)must drop the argument. The low-level API still takes it. - The
parserandformattermodules are removed. hashlibandsslneed OpenSSL 1.1.1 or newer (PEP 644), andSSLContextdefaults to TLS 1.2 as the minimum.- Functions that take integers stop accepting objects that only define
__int__()without__index__(), such asDecimal. urllib.parse.parse_qs()accepts one separator,&by default, so;no longer splits query strings.
Checked against: source 2
What does 3.11 remove on top of that?
The 3.11 list is shorter but hits old async code and old introspection helpers.
- The
@asyncio.coroutinedecorator is gone; writeasync def. inspect.getargspec()andinspect.formatargspec()are removed in favour ofinspect.signature().- The
binhexmodule and thebinasciihqx functions are removed. lgettext()and the otherl*gettext()functions leavegettext.open()no longer accepts the'U'mode flag.random.sample()stops converting a set to a sequence, andrandom.shuffle()loses itsrandomargument.- Converting a very long decimal string to
intraisesValueErrorpast 4,300 digits by default. The 3.10 notes carry the same limit as a later security change, so a patched 3.10 hits it too. - Nineteen PEP 594 modules, including
cgi,cryptandtelnetlib, start warning ahead of removal in 3.13.
Which 3.12 removals fail as soon as a module is imported?
3.12 has the longest Removed section of the three. These are the ones that stop a program at import or at first call rather than changing a result.
distutilsis removed. Installing setuptools still provides it, as the notes say.venvno longer installs setuptools, sopkg_resourcesandeasy_installare missing unless setuptools is declared as a dependency. Building packages is a separate path, covered in pip cannot find setuptools.impis removed. The notes give a mapping table, for exampleimp.reload()toimportlib.reload(), and a recipe to replaceimp.load_source().asynchatandasyncoreare removed in favour ofasyncio;smtpdpoints to theaiosmtpdpackage.unittestdropsassertEquals,assertNotEquals,assertRegexpMatches,failUnlessand other old aliases.configparserlosesSafeConfigParserandreadfp(); useConfigParserandread_file().ssl.wrap_socket()andssl.match_hostname()are removed; the notes point toSSLContext.wrap_socket().locale.format()is removed in favour oflocale.format_string().
Checked against: source 4
What changes quietly, without an import error?
Some changes pass every import and only show up in results or warnings. In 3.12 an invalid escape such as "\d" in a normal string emits SyntaxWarning instead of DeprecationWarning, and the notes say it will become a SyntaxError later. datetime.utcnow() and utcfromtimestamp() are deprecated in favour of timezone-aware calls.
Also in 3.12: cached_property drops its class-wide lock, so a getter can run twice under a thread race; randrange(10.0) raises TypeError; the os module rejects bytearray paths; and mixing tabs and spaces in one file raises TabError.
Earlier hops add their own. In 3.11, re fixes bugs that could return wrong capture groups and allows global inline flags only at the start of a pattern. In 3.10, urllib.parse strips newlines and tabs from URLs, and collections.abc.Callable flattens its __args__.
What else do people ask?
Is 3.12 still a sensible target when it already takes security fixes only?
Its scheduled end is October 2028 on the devguide page. Moving to 3.13 or 3.14 means reading one or two more What's New pages, including the PEP 594 removals that 3.11 announced for 3.13.
Do the What's New pages cover my dependencies?
No. They describe CPython and its standard library. Each third-party package states its own supported Python versions, so check those before each hop.
Sources
- Python Developer's Guide, Status of Python versions, fetched 2026-11-20
- Python documentation, What's New In Python 3.10, fetched 2026-11-20
- Python documentation, What's New In Python 3.11, fetched 2026-11-20
- Python documentation, What's New In Python 3.12, fetched 2026-11-20
- Python documentation, Python Development Mode, fetched 2026-11-20
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. This page reads the Python devguide status page and the What's New pages for 3.10, 3.11 and 3.12, fetched on 20 Nov 2026. I did not upgrade a codebase for it. It does not cover C extensions, the C API changes, third-party packages or operating-system Python packages. Found a mistake? Tell me.