Safeguard
Security Guides•

Is Python 3.9 end of life? What to do about it

Python 3.9 reached end of life on 31 October 2025 and gets no security fixes. See which version to pick next and how to upgrade in safe steps.

Safeguard Security Team
3 min read

Yes. Python 3.9 reached end of life on 31 October 2025, according to the Python developer guide. The core team no longer releases security fixes for it. If you still run 3.9, plan a move to a supported version such as 3.12, 3.13 or 3.14.

What the support calendar says

Python releases a new feature version every year and supports each for five years. The developer guide lists these end of life dates:

VersionEnd of lifeNote
3.931 Oct 2025Ended
3.101 Oct 2026Ended
3.11Oct 2027Scheduled
3.12Oct 2028Scheduled
3.13Oct 2029Scheduled
3.14Oct 2030Scheduled

The guide says dates in italics are scheduled and can be adjusted, so recheck before you commit to a long plan. We have a separate post on the 3.10 end of life.

Why it matters even for private code

The interpreter is not the only part that ages. Libraries drop old Python versions, usually a year or two after the interpreter does. When you pin to 3.9, you eventually stop getting new releases of your dependencies, including their security fixes. So an old interpreter quietly freezes your whole dependency tree.

How to choose the target

Pick the newest version your key libraries support, not the oldest that is still supported. A newer target gives you more years before the next forced move. Check the classifiers on your main packages, then run your tests under two candidate versions.

Upgrade steps

  1. Search for the version everywhere: Dockerfiles, CI, pyproject.toml, .python-version, tox files and base images.
  2. Turn on deprecation warnings in tests with python -W error::DeprecationWarning -m pytest and fix what surfaces.
  3. Upgrade pip tooling and regenerate your lock file on the new version.
  4. Run tests in CI on old and new versions side by side for a few days.
  5. Rebuild wheels for any compiled dependencies.
  6. Switch deployment, then remove the old version from CI.

Try it yourself

Open the demo and note how each dependency shows its version, which tells you what an old interpreter is holding back.

Click through it at your own pace, or open it full screen.

Quick check

Will Python 3.9 code run on Python 3.12?

Mostly yes, but removed modules and changed behaviour can break specific code. The test run with deprecation warnings enabled will show you where.

Do virtual environments protect me from an old interpreter?

No. A virtual environment isolates packages, not the interpreter. It still runs the end of life Python underneath.

Where Safeguard fits

Safeguard's dependency scanning reads your lock files and manifests, so you can see which projects pin which Python-era dependencies before you start. A free scan is a quick way to get that first list.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.