r/Python • u/timmywick • 27d 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?
8
u/Thefuzy 26d ago
This is some grade A slop
1
u/timmywick 26d ago
Care to elaborate on how it’s considered slop?
14
u/barkwahlberg 26d ago
Heads up: the real tell—it is all slop. I need to be honest here: that's the load-bearing seam. It's not just a little slop. It's all slop. Extra parenthetical and shorthand that's invented earn their keep. If it's brevity or clarity, brevity wins, and that's what bites here. Worth writing anything at all, even one sentence, yourself next time. That's the real success path.
0
u/timmywick 25d ago
Fair enough if the writing style isn't your thing i guess?? The dates and pricing come straight from AWS's own docs, and the deadline is real. If anything on the site is actually wrong, point it out and I'll fix it.
1
u/barkwahlberg 25d ago
The deadline is real?!? I thought it was fake!
1
u/timmywick 25d ago
each reddit post is due at least one keyboard warrior with nothing better to do haha
2
u/barkwahlberg 25d ago
Fair hit. One caveat: Reddit posts written by a human read differently than Reddit posts written by an LLM, and that's what bites. The intent stays, while the jargon doesn't earn it's keep.
1
u/timmywick 25d ago
again I apologize my writing style doesn’t fit your criteria? I wasn’t aware I had to write/type etc. in a certain way to satisfy only you 😂 Plenty of people on here are having constructive conversations about the post and you just seem sad and bored.
1
u/barkwahlberg 25d ago
True, though the top comments both note that it's clearly AI written. Takeaway: use the LLM for research, then write your Reddit posts and comments yourself using your human voice.
1
0
13
u/ResidentPomegranate6 27d 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.
4
u/timmywick 27d ago
Great call, thanks. That's an easy one to miss since it shows up as an SSL error, not an obvious version conflict. Bumping requests/urllib3 in a separate deploy first, while still on 3.10, also makes it easier to tell which change broke what.
1
2
u/lasithajay 26d 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.
0
u/timmywick 26d ago
Yeah, Pydantic is sneaky on Lambda. One thing that helped: if you jump to v2, pydantic-core is a compiled package, so your layer or zip has to be built for the exact Python version and architecture you're deploying to, or it fails on import. And if a full v2 migration is too much right now, v2 ships a pydantic.v1 shim you can import from to buy some time.
2
u/jamesinc 26d ago
The biggest one for us was the introduction of StrEnum in Python 3.11 that was also accompanied by behaviour changes in how a class inheriting str, Enum behaves when serialised.
2
u/timmywick 26d ago
Yeahhhhh that one bites people because nothing errors, you just get "Status.ACTIVE" showing up in your f-strings / log lines / query params instead of "active". 3.11 changed format() on (str, Enum) mixins to match str(). Easiest fix is switching to StrEnum, or using .value explicitly where it matters. worth grepping for f"{some_enum}" before bumping the runtime.
4
u/ApertureDrift2 26d ago
Python upgrades are never just changing a version number. There's always one dependency waiting to ruin your day
2
u/Senior_Ad9680 26d 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
10
u/acdha 26d ago
That’s just creating more problems for yourself in the future - like we’ve had two critical security updates in the last week which you’re not getting if you don’t patch dependencies.
1
u/Senior_Ad9680 26d ago
Well yeah of course, but that’s on the orgs/teams responsibility to have that observability built into their process right. You should absolutely upgrade to the latest supported python version but how many enterprise companies are still running out of date software 😂
1
u/Khavel_dev 26d 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.
1
0
u/AleDev99 25d 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.
1
u/DeaD_EyE_1 25d ago
This never worked correctly.
1
u/AleDev99 25d ago
Interesting, which part broke for you? The replica lag on the dashboard, or the analytical queries still hitting the primary? Curious what you ended up doing instead.
39
u/nicholashairs 27d ago edited 26d ago
This reads like AI, but seems actually genuinely useful 👍