Migrating production infrastructure? Get up to ₹10,000 in migration credits. Apply now
voroaBlog
Web Services

Python 3.15: What's New and When to Upgrade Your App

· · 3 min read

Python 3.15 - UTF-8 by default, lazy imports, frozendict and a new profiler

Python 3.15 was released on 9 October 2026, a week later than planned, and it is now seven weeks old - long enough for the first wave of library updates, short enough that many teams have not looked yet.

For web developers, two changes matter most: Python now uses UTF-8 as its default text encoding everywhere, and there is a supported way to make imports lazy, which shortens start-up time for large apps. This post covers those, the smaller additions, and a sensible upgrade order.

Advertisement

The changes that matter for web apps

The full list is in the official What’s New in Python 3.15. The ones a typical Django, Flask or FastAPI app will feel:

  • UTF-8 by default (PEP 686). File reads and writes now default to UTF-8 instead of the system’s locale encoding. Code that relied on a Windows code page, or on a server whose locale was not UTF-8, may now read files differently.
  • Explicit lazy imports (PEP 810). A module can mark imports as lazy so they load on first use. Large apps with many optional dependencies can start faster, which also shortens restarts after a deploy.
  • A built-in frozendict (PEP 814) - an immutable dictionary, handy for configuration and cache keys.
  • A sentinel type (PEP 661) for the “missing value” pattern that libraries kept reinventing.
  • Frame pointers on by default (PEP 831) and a new sampling profiler under profiling.sampling, so profiling a live process is easier and more accurate.

Diagram: Python 3.15 at a glance - UTF-8 default, lazy imports, frozendict, and the sampling profiler

The one change to test before anything else

UTF-8 by default is the change most likely to bite. If your app reads CSV uploads, writes report files or parses text from older systems, run that code on 3.15 with real sample files. Anywhere you depended on the old behaviour, make it explicit:

python
with open(path, encoding="cp1252") as f:  # say what the file really is
    data = f.read()

The reverse is also worth a search: delete the encoding="utf-8" arguments you added as a workaround only after the app no longer runs on older Pythons.

When to upgrade

A practical order for a production app:

  1. Wait for your framework. Check that your framework release lists 3.15 as supported. Django 6.1, for example, added Python 3.15 in a point release.
  2. Check compiled dependencies. Packages with C extensions need 3.15 wheels; without them, installs fall back to building from source and often fail.
  3. Run the test suite on 3.15 in CI alongside your current version.
  4. Switch one service first, ideally the least critical, and watch error rates for a few days.

There is no rush if you are on 3.12 or later - those versions are still supported. The case for moving soon is the start-up gain from lazy imports in large apps, not security.

Devanagari, Tamil and mixed-script text

Indian business apps often handle text in more than one script - names in Devanagari or Tamil, addresses mixed with English, invoices exported to Excel. UTF-8 by default is good news there, but it is also where encoding bugs hide: an upload pipeline that used to read a file as the server’s locale may now read it differently. Test with the real files your customers send, not with ASCII samples.

Upgrading on Voroa

Voroa reads the Python version from your repository - requires-python in pyproject.toml, a Pipfile, .python-version or runtime.txt - and builds on Python 3.12 when none is declared, as our Python hosting page explains. A brand-new release depends on the build image having it, so declare 3.15 on a branch first and check the build log before you merge:

text
3.15

For the deploy steps themselves, see deploying Django or our guide to Django hosting in India. If the new version misbehaves, roll back to the previous deploy while you fix it. Everything runs as a web service in Mumbai, billed in rupees.

Advertisement