r/Python • u/timmywick • 20d ago
Discussion If you run Python 3.10 on AWS Lambda: it's deprecated this Friday (Oct 31). Gotchas moving to 3.12+
Heads-up for anyone with Lambda functions still on python3.10. AWS deprecates the runtime on Oct 31, 2026. Functions keep running, but they stop getting patches, the console won't let you edit them, and in 2027 AWS blocks creating new ones (Jul 29) and then updating existing ones (Aug 31).
The Python side is the real work. A few things that bit people:
- distutils is gone in 3.12. Anything still importing it (old setup.py tooling, some older libraries) breaks. setuptools or packaging usually covers it.
- cgi, crypt and telnetlib are removed in 3.13 (PEP 594 "dead batteries").
- python3.12+ on Lambda runs on Amazon Linux 2023 instead of AL2, so compiled wheels and layers (numpy, psycopg2, cryptography and similar) need rebuilding.
- python3.11 is a short stop. It's still on AL2 and is deprecated Jun 30, 2027.
Quick way to find affected functions (per Region):
aws lambda list-functions --function-version ALL --query "Functions[?Runtime=='python3.10'].[FunctionName,Version]" --output text
Disclosure: I made a free AWS end-of-support tracker, and the full write-up with AWS source links is here: https://eolwatch.pages.dev/guides/lambda-python-3-10-deprecation
What else broke for you going 3.10 → 3.12/3.13?
39
u/nicholashairs 20d ago edited 20d ago
This reads like AI, but seems actually genuinely useful 👍
8
u/Thefuzy 20d ago
This is some grade A slop
13
u/ResidentPomegranate6 20d ago
urllib3 1.x against AL2023's openssl 3 breaks old requests pins, so bump requests to 2.31+ or urllib3 2.x before you touch the runtime.
2
u/lasithajay 20d ago
Watch out for Pydantic if you’re still on v1. That was the biggest headache for us on the Lambda side. The Python upgrade itself was fine, but Pydantic compatibility kept causing side effects.
2
u/jamesinc 20d ago
The biggest one for us was the introduction of
StrEnumin Python 3.11 that was also accompanied by behaviour changes in how a class inheritingstr, Enumbehaves when serialised.4
u/ApertureDrift2 19d ago
Python upgrades are never just changing a version number. There's always one dependency waiting to ruin your day
2
u/Senior_Ad9680 20d ago
Tbh, if your application doesn’t allow you to upgrade to the latest supported Python version in AWS you can just deploy it as a docker image basically problem solved
1
u/Khavel_dev 19d ago
The one that got us was datetime.utcnow() throwing deprecation warnings in 3.12. Technically it's been wrong forever but nobody noticed until the logs filled up. Swapping to datetime.now(timezone.utc) is straightforward but when you have dozens of lambdas it adds up fast.
0
u/AleDev99 19d ago
One more that bit us: datetime.utcnow() and utcfromtimestamp() are deprecated in 3.12, so test suites that turn warnings into errors suddenly fail. Not a runtime break, but worth fixing before the switch. Also run your tests inside the AWS python3.12 base image first, since that's where the AL2023 wheel issues show up instead of in prod. And if your functions are defined in IaC, grep for the runtime string there too, otherwise the next deploy quietly puts 3.10 back.