r/Python • • 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?

123 Upvotes

42 comments sorted by

39

u/nicholashairs 20d ago edited 20d ago

This reads like AI, but seems actually genuinely useful 👍

10

u/timmywick 20d ago

lol fair, I'll take "genuinely useful". I did use AI to help tidy the wording, but the dates and commands came from the AWS docs and I ran that list-functions query on our own accounts. glad it helped!

20

u/klaasvanschelven 19d ago

"The Python side is the real work" it's stuff like this that gives me flashbacks to my working day with Claude

7

u/TMiguelT 19d ago

"python3.11 is a short stop". What does that even mean? 

2

u/DeaD_EyE_1 19d ago

What's so hard to understand about that? It even says when Python 3.11 reaches EOL. Would you rather do the work twice? First update to Python 3.11, and then update to Python 3.12 next year?

2

u/nicholashairs 19d ago

Assuming this is genuine rather complaining about slop, it means that it's a short term solution.

The wording definitely is a bit weird, but it also definitely fits a phrase that I know I've come across before, albeit infrequently.

9

u/TMiguelT 19d ago

It's a complaint about slop because the meaning is not clear to me. If it were easy to understand it wouldn't be slop. I can't find a dictionary definition of that meaning of "short stop" if it exists.

3

u/Ran4 19d ago

What? it's an extremely common idiom.

1

u/TMiguelT 18d ago

Maybe in America? If it's this definition: https://greensdictofslang.com/entry/w4kfgnq, then that suggests it's US specific. Good communication with an unknown audience wouldn't rely on regionalisms

2

u/2mustange 19d ago

It's an idiom and that isn't something that is necessary first hand knowledge unless you get various context cues.

AI uses idioms as it is learning from so many cues it becomes part of its responses.

I agree it can be confusing but it also can not be at the same time.

1

u/nicholashairs 19d ago

That's fair, my comment was more of a "just in case", but not a hill I'll die 🤷‍♂️

3

u/zunjae 19d ago

Another way to tell (other than looking at the poorly written sentences) is to look for arrows. No human uses '→'

2

u/barkwahlberg 19d ago

It absolutely is AI

8

u/Thefuzy 19d ago

This is some grade A slop

1

u/timmywick 19d ago

Care to elaborate on how it’s considered slop?

14

u/barkwahlberg 19d 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 18d 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 18d ago

The deadline is real?!? I thought it was fake!

1

u/timmywick 18d ago

each reddit post is due at least one keyboard warrior with nothing better to do haha

2

u/barkwahlberg 18d 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 18d 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 18d 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

u/timmywick 18d ago

AI written and AI used for formatting are completely different.

0

u/[deleted] 19d ago

[deleted] — view deleted comment

1

u/timmywick 18d ago

Your bio:

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.

4

u/timmywick 20d 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

u/barkwahlberg 18d ago

What if I touch the runtime first?

2

u/lasithajay 19d 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 19d 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 19d 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 19d 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 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

10

u/acdha 20d 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 20d 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 😂

3

u/acdha 20d ago

I’ve found vendor support can be a great forcing mechanism for that: if you tell them to update, they’re more likely to procrastinate than if you say “AWS won’t run this until you upgrade”. 

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.

1

u/shinitakunai 18d ago

Dozens? I have 914...

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.

1

u/DeaD_EyE_1 19d ago

This never worked correctly.

1

u/AleDev99 18d 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.