Brought to you by Talk Python Courses and Six Feet Up consulting

#506: Raft, Rust, and release day

Published Tue, Nov 24, 2026, recorded Tue, Nov 24, 2026
0:00
00:30:40
Watch this episode on YouTube
Play on YouTube
Watch the live stream replay

About the show

Sponsored by LongLink: Open-source platform for building and running custom business applications with Python and FastAPI

Connect with the hosts

Join us on YouTube at pythonbytes.fm/live to be part of the audience. Usually Tuesday at 7am PT. Older video versions available there too.

Finally, if you want an artisanal, hand-crafted digest of every week of the show notes in email form? Add your name and email to our friends of the show list, we'll never share it.

Calvin #1: De-fanging dangerous triggers in GitHub Actions across an organization

  • GitHub will block pull_request_target by default in public repos starting Dec 2, 2026. GitHub announced this in its changelog on Nov 2; it isn't in effect yet. That default stops applying once you set your own event policy.
  • Two triggers are the main danger. pull_request_target and issue_comment both run with a token that can write to the repo and with the repo's secrets. The classic "pwn request" is a workflow that checks out a stranger's PR code and runs it.
  • It's not theoretical. Ultralytics (Dec 2024), LiteLLM and Telnyx via Trivy (Mar 2026), and elementary-data (Apr 2026), where a single crafted PR comment led to a malicious release on PyPI.
  • To get started, the first step is an Actions event policy. On GitHub Team or Enterprise, one org-wide policy allows only the triggers you expect: pull_request, push, release, repository_dispatch, schedule, workflow_dispatch, workflow_run.
  • Start in Evaluate mode. It blocks nothing and logs what would have been blocked under "Policy insights". Leave it on long enough to cover a release and your least frequent scheduled job.
  • Free plans have to do it repo by repo. You apply the same policy through gh api /repos/$repo/actions/policies. New repos have no policy until someone adds one.
  • Find what you have: gh search code pull_request_target path:.github/workflows --owner YOUR-ORG, also search for issue_comment and then zizmor to check each repo's workflows.
  • PSF status: the policy is set up for the pypi org. In the python org, Seth Larson is still migrating the last few repos before turning it on. The post's intro says all three orgs are done; I'm going by the body, which is more specific.

Michael #2: RQlite - The fault-tolerant relational database built on SQLite.

rqlite is a self-hosted distributed relational database built on SQLite and the Raft consensus protocol. It puts SQLite behind an HTTP API and replicates data across machines. For Python developers, the appeal is familiar SQL and lightweight deployment, with a database that can survive a server failure.

  • Keep SQLite's SQL, add high availability. A three-node cluster can survive one node failing, provided the remaining nodes can communicate.
  • Python applications send SQL and parameters over HTTP as JSON. Integrations include pyrqlite and sqlalchemy-rqlite; check client capabilities before migrating existing code.
  • Deployment is a single binary per node, with Docker and Kubernetes options. Features include full-text search, JSON support, SQLite extensions, change data capture, and automated cloud backups.
  • Replication does not scale writes. Every write goes through the leader and Raft log, adding network and disk overhead compared with standalone SQLite.
  • Transactions must fit within one HTTP request. You can execute a batch atomically, but cannot hold a transaction open across requests. Explicit BEGIN/COMMIT/ROLLBACK control is unsupported.
  • Read consistency is configurable: default Weak normally reads from the leader; Linearizable adds quorum checks; None permits potentially stale local reads. Stronger guarantees cost coordination.
  • Discussion angle: when does SQLite need clustering rather than just backups? Proposed demo: write from Python, stop the leader, then show the surviving cluster accepting requests after election.

SPONSOR SEGMENT: LongLink

Michael #3: diskcache-oxide now supports Django

diskcache-oxide plugs into Django’s existing cache framework for page caching, template fragments, low-level cache calls and sessions. Worker processes on the same machine share one cache on disk, with atomic counters across processes. The appeal is keeping Django’s familiar caching API without running Redis or Memcached.

  • Setup uses the package’s django extra, diskcache_oxide.DjangoCache as the backend, and an absolute directory for LOCATION. Existing Django cache calls stay the same; optional sharding spreads contention across multiple cache files.
  • Keep disposable pages separate from session state. The recommended configuration uses two aliases and directories: page-cache failures become misses or dropped writes, while session writes raise on failure and sessions are not evicted for size. The backend rejects session configurations that silently drop writes.
  • The companion Django example runs four Gunicorn workers and demonstrates cached views, template fragments, sessions and a shared visit counter. Response headers identify which worker answered, and multiprocess tests check concurrent increments, sessions across workers and caches opened before forking.
  • This shares a cache across processes on one machine, not across a fleet. Django’s get_or_set() can still compute twice when workers miss together. A cached view that reads sessions also needs vary_on_cookie to avoid serving one visitor’s personalized response to everyone.

Calvin #4: Muru: an AI-assisted Rust server for Python apps from mod_wsgi's creator

Simon Willison's post (repo: muruhq/muru · author's series: Twenty years of mod_wsgi)

  • What it is: Muru is Graham Dumpleton's successor to mod_wsgi, 20 years after he started writing mod_wsgi in December 2006. It's not an Apache module and not another server you put behind nginx. He means it to handle running a Python web app from your laptop through to production.
  • The parts: muructl is a single Rust binary that handles HTTP/1.1, HTTP/2, TLS, static files and compression, and never runs Python. A Python host process imports your app once and forks workers from it. A controller decides what runs and is never on a request's path.
  • It hosts more than WSGI: ASGI and gRPC too, all in one app. Requests can be handed from WSGI to ASGI, so an existing WSGI app can add websockets without a rewrite. Flask and Django run unmodified, e.g. muructl run mysite.wsgi:application.
  • Every deploy is a new release: a release starts next to the old one and traffic moves only once it's ready. If the new code won't even import, the old release just keeps serving. Even dev-mode auto-reload works this way, and the same mechanism gives you blue/green, canaries and rollback.
  • It understands Python apps: the access log splits waiting time (queue=, every thread was busy) from your code's time (app=), so you can tell "add capacity" from "fix slow code". Each scaling policy can scale workers to zero and optionally stop the host process too.
  • Fun tie-in with the lazy-imports story: his "when lazy imports help" post argues that PEP 810 lazy imports can hurt a pre-forking web server. Deferred modules load separately in each worker, so they aren't shared through copy-on-write memory. Muru measures import costs per app instead of guessing.
  • Status: alpha, pre-releases only. Install with uv tool install muructl. It runs on Linux and macOS with CPython 3.11+, including free-threaded builds, and is Apache-2.0 licensed.
  • The AI angle: Dumpleton says most of the code was written by AI, while he handles design, review and steering. It's about a month old, and he's in the Claude for Open Source Program. He doesn't accept patches: "don't send me a patch, just describe the problem." Quote: "deciding what isn't good enough yet is still down to me, and twenty years of getting things wrong with mod_wsgi turns out to be useful for that."

Extras

Michael:

  • Black Friday is on at Talk Python Training
  • My first CPython issue
  • PyCon US 2027 call for proposals is open
  • nginx2root - patch your nginx now
    • Credit Jake Howard
    • F5 shipped nginx 1.31.9 (mainline) and 1.30.7 (stable) on November 18, 2026. They fix five memory-corruption bugs that Xint named nginx2root. Each one is a path to unauthenticated remote code execution. If nginx fronts your Python apps, check your version today.
      • The big one is CVE-2026-123007, an integer underflow in HTTP/2 flow control. It has been in every release since HTTP/2 landed in 1.9.5 in 2015, and a reachable TLS port with HTTP/2 on is enough.
      • Exposure is huge. Xint counted 11.94 million nginx hosts on Shodan that report a version, and 98.9% were in the affected range.
      • The fix is to upgrade. Setting http2 off; is a stopgap that blocks only two of the five. The other three hit the DNS resolver, HTTP/3, and the mail proxy.
      • Docker does not save you. Xint chained the nginx bug with an unpatched Linux kernel SCTP flaw to go from the nginx worker in a container to root on the host. Block the sctp kernel module if you don't use it.
      • AI found most of it. Four of the five came from Xint's autonomous scanner with no human steering, and Wiz found the HTTP/2 pair with its AI code scanning harness. Xint and Wiz are withholding their exploits and no attacks in the wild are reported, but some outlets say a public PoC hit GitHub the same day.

Joke: What they think grid

Episode Transcript

Collapse transcript

00:00 Hello and welcome to Python Bytes, where we deliver Python news and headlines directly to earbuds.

00:05 This is episode 506, recorded November 24th,

00:08 2026.

00:10 I am Michael Kennedy.

00:11 And I'm Calvin Hendrix-Parker.

00:12 This episode is brought to you by Longlink, the open source platform for building and running custom business applications with Python and FastAPI.

00:20 Check them out. The link is in your podcast player show notes.

00:22 Tell you more about them later.

00:23 Connect with us on all the socials.

00:25 That's on top of the page.

00:27 And sign up for the Friends of the Show List.

00:30 We'll send you really cool announcements and summaries,

00:34 even deeper dives into some of these topics than what we might normally cover.

00:39 Speaking of covering things, you know, it can be a dangerous world, Calvin.

00:43 It is a potentially dangerous world out there.

00:45 And I'm glad to see that some people are doing something about it.

00:49 This is actually a blog post from the Python Software Foundation.

00:52 Don't let the blogspot.com URL fool you is actually the actual PSF.

00:59 But Mike.

00:59 I'm going to create a mashup.

01:01 Oh, my goodness.

01:03 It's a web2o.

01:04 A Yahoo mashup with that quest.

01:07 Sorry, PSF.

01:08 We may want to get a real blog at some point.

01:11 I'm trying to throw not too much shade against blogspot, but it is blogspot.

01:14 But no, Seth and Mike have basically kind of covered the fact that GitHub is going to start

01:19 blocking some dangerous triggers by default. So there's a couple of them,

01:24 specifically pull request target and issue comment.

01:29 These are basically things that have been used in some of

01:32 the recent supply chain attacks.

01:35 These basically let a stranger on the GitHub internet or the

01:38 internet start workflows that may have access to your secrets.

01:41 So are very, very dangerous.

01:45 They actually, so Mike and Seth, I believe they were,

01:49 there's a post.

01:51 Yeah, here it is.

01:51 The Alpha Omega blog, the full details of the technical documentation about what they wrote

01:56 up from the Python Software Foundation side of things is actually available over there

02:00 on this link here into the Alpha Omega blog.

02:03 But basically, the first step is basically to handle actions in event policy.

02:09 the GitHub team, and even on GitHub teams or enterprise or an org-wide policy allows only

02:15 triggers you expect.

02:17 So there's common ones like pull requests and push and release.

02:19 So those are ones coming from like people in your organization.

02:23 But if you have an open source project, someone can

02:25 leave a comment and maybe you had an issue comment trigger and a misconfigured one of those could

02:30 cause havoc to ensue.

02:34 GitHub's obviously releasing this in an evaluation mode. This is coming on

02:38 December 2nd for public repositories.

02:41 So as they say in the post here, if that means nothing to you,

02:44 this post is for you and if it fills you with red, this is

02:47 also for you.

02:48 This affects everyone.

02:49 Anyone who has got a public GitHub repository out there, maybe you know or don't know that you've been using these

02:56 pull request target or the issue comment target and cause things to happen.

03:01 That's what you got to watch out for here.

03:03 The free plans do are gonna be done.

03:06 let's see here, free plans are gonna be done repo by repo.

03:08 You can apply the same policy through the GitHub command line if you wanted to.

03:13 And new repos have no policy until someone adds one.

03:16 So I don't know if you've noticed that recently,

03:18 that there are no default policies added anymore

03:21 for actions like that.

03:22 That's probably wise because then you, there won't be unexpected things happening

03:26 that you didn't configure to happen.

03:29 The policy right now is set up for pypi.org.

03:32 And so on python.org, Seth's been migrating the last few repos before turning it fully on.

03:39 The post entry says that all three orgs are now done and going into

03:43 basically what the specifics of it are in that blog post.

03:47 Again, this is real.

03:49 The probably recognize some of these names like the LightLLM supply chain attack was caused by a

03:55 pull request target exploit being pulled there.

03:59 So we've seen this happen.

04:01 Again, their post goes into what's going on.

04:04 If you've got those two triggers active, they're gonna be just deactivated.

04:07 If you've got them active right now, you should probably go ahead and deactivate them on your own.

04:10 Yeah, for sure.

04:11 You know, you hear about certain things being taken over for supply chain issues

04:16 and people are like, "How is this possible without the code changing at all?"

04:20 Well.

04:20 Here it is.

04:22 It's the infrastructure underneath it that's...

04:24 These kinds of tools make it nice and convenient

04:28 and frictionless for us to be developers of open source projects and provide software to the world.

04:34 but it comes with a lot of little sharp edges that we just,

04:37 you know, as you say, it's hard to have nice things.

04:39 If there's people, if there's people out there who are going to abuse them.

04:42 I mean, if that was the case,

04:43 we'd go back to using like Telenet or R login and just forget encryption

04:47 altogether.

04:47 Who needs it?

04:48 I'm on team Archie.

04:50 Let's go.

04:50 That was a gopher user.

04:52 Gopher user.

04:52 Let's go.

04:53 Oh my gosh.

04:55 I used both of those a little bit in those super early days of the internet

04:58 before the web existed. I still don't know what they are.

05:01 Yep.

05:01 So yeah, you can see here that they, Again,

05:04 Alpha Omega supported the work done by the Python Software Foundation folks with Seth and Mike.

05:10 There was analysis that got funded for looking at each of those attacks and understanding what happened.

05:15 And we thank them for the things they're doing.

05:18 Yeah, fantastic.

05:19 Alpha Omega actually does a lot of contributions.

05:22 So we're cool.

05:23 Have I mentioned that I'm on this sort of SQLite kick?

05:27 I was surprised and not surprised that we're still talking about SQLite projects.

05:32 still talking about SQLite projects.

05:34 This one is super interesting.

05:36 What if you could say, I would like database,

05:39 but even though I like SQLite, I would really want it to maybe run on

05:45 a different machine, or I want it to be more durable,

05:47 more highly available.

05:49 Well, have I got a cool project for you?

05:51 RQ Lite.

05:52 Instead of SQLite, it's RQ Lite.

05:54 And what it is, is it is a basically a front end to a really interesting set of features on top of SQLite.

06:02 So what you do is you go and run this app, you set it up,

06:05 and its expected way to run, it doesn't have to run this way, but its expected way to run is in a cluster of database servers,

06:13 all backed by SQLite.

06:15 Interesting.

06:15 Okay.

06:16 Okay.

06:16 Go on.

06:17 Yes.

06:18 Now you got my attention.

06:19 Yeah, so you start a server, and then you start a second one.

06:23 Could be on the same machine as a different Docker container,

06:26 or it could even be on a, you know, maybe on even a different machine.

06:29 And then you attach it to the original one.

06:31 You could start a third, fourth, fifth, whatever, how many you want.

06:34 It uses the raft voting protocol to decide if one of these machines goes down,

06:39 how does it keep running?

06:40 So this is pretty interesting.

06:42 Then you query it in either just pure HTTP as just a JSON endpoint,

06:48 or you can get a client.

06:49 Like there's a Python client here that you can get.

06:52 And really the way it works, here's an example,

06:55 is you basically just treat it as a DB API.

06:59 I don't know if people are familiar with this term, but this is the built-in way to talk to...

07:03 Old school.

07:03 Yeah, it's old school, like straight raw SQL.

07:06 And that's how you talk to it, right?

07:07 You could, of course, take this...

07:09 I'm pretty sure you could take this connection because it's just a DB API connection

07:13 and pass it on to something like an ORM.

07:15 I don't see why not.

07:16 It's plausible.

07:17 So anyway, it has all these different libraries.

07:19 It's got Go, Python, TypeScript, JavaScript,

07:21 Broth, C#, et cetera, et cetera.

07:23 And they're asking for, hey, make us another one if you look at this and it's not enough.

07:27 So this is pretty neat.

07:28 It's just a self-contained single binary.

07:30 Fires up.

07:31 I'm guessing that Go being on the top of the list.

07:33 Let's just go find out.

07:34 That's 18,000 stars.

07:36 So this is not just a little toy thing.

07:37 And yes, it's written in Go.

07:39 So yeah, it's just a single Go binary that you go deploy.

07:42 It runs on Docker Compose and Kubernetes.

07:45 It has all the power of SQLite.

07:47 SQLite extensions.

07:48 You can stream changes with change data capture built in.

07:53 And it also automatically, like LikeStream,

07:56 automatically streams continuous backups to S3, Min.io, and Google Cloud.

08:00 So instead of having just, yes, if one part of the cluster goes down,

08:05 you can get to the other.

08:06 But it's like you can say, I want it the way it was seven seconds ago.

08:09 Not now.

08:10 You know what I mean?

08:11 Like you could point like continuous point in time backup,

08:14 which is kind of the opposite of what you think with like SQLite, right?

08:17 Like you don't think of it.

08:18 Yeah.

08:20 It's really wild.

08:21 Like I said, 18,000 GitHub stars.

08:23 It's not just like a little toy.

08:25 It comes with a UI for monitoring the cluster health,

08:30 for monitoring the schema, for all sorts of different things.

08:33 So yeah, it has its own little UI.

08:36 And so anyway, I want to put this out there.

08:38 This is by Philip O'Toole, I believe.

08:42 At least the thing is trademarked by Philip O'Toole.

08:44 You need to have this person on Python so I can understand better why they started this project.

08:48 I know. It's very interesting, isn't it?

08:50 But it sounds like the, I mean, obviously you can read out of all these replicas,

08:56 but writes are still happening in one spot and then getting spread across all of them.

09:01 Right.

09:01 I believe so.

09:02 And I believe that's why it has the raft consensus algorithm,

09:05 because it's got to decide who is in charge of receiving the writes,

09:08 you know?

09:08 Right.

09:09 So if you have a hundred replicas, that sounds terrible.

09:12 It's probably not a good idea.

09:13 Yeah.

09:14 I mean, maybe it's a good idea.

09:15 Maybe if you make sure that they're all read replicas, I don't know too much,

09:19 but there's a whole section in the docs about clusters somewhere as well i i this wasn't on my bingo

09:25 card for today no no i'm sure here we go somewhere down here yeah you got your general guidelines

09:31 about clustering and building clusters and i just think it's interesting it's it's it's a very

09:36 wild idea a very wild way to create a super high availability as simple as sqlite but remember

09:43 sqlite does like hundreds of thousands of read writes a second on one machine on one yeah it's

09:49 there's some really interesting building blocks here.

09:51 But I think that's because it wasn't trying to do all these things.

09:56 Well, it's definitely going to go slower because you've got to talk to it over HTTP,

09:59 right?

09:59 I mean, a single request will go slower,

10:01 but it might still be pretty scalable.

10:03 I don't know.

10:04 We shall see.

10:04 But it's just something else.

10:06 I thought it was, you know, what an interesting way to create database.

10:10 It's popular enough that it's not just like, oh, here's a random interesting thing

10:14 that's probably unreliable and unmaintained.

10:16 You know what I mean?

10:17 Well, I'd love to hear from more viewers if they've got a use case for this.

10:21 Yeah, if people are using this out there, let us know.

10:24 Yeah, I'd love to know.

10:25 It would be so good.

10:27 But let's talk about Longlink, our sponsor.

10:31 Yeah, so our sponsor for this episode.

10:33 So thank you to Longlink for sponsoring this show.

10:36 And as I said at the opening, this is a way where you can build a substrate for building your business applications on top of them with AI.

10:47 It gives you a lot of shared cool features.

10:49 Longlink is a growing startup out of Switzerland.

10:51 So they asked the question, how much of your company still runs on spreadsheets?

10:56 For most businesses, a lot.

10:58 Approvals live in email threads, tracking lives in shared Excel files.

11:01 One, you get these off the shelf software

11:04 that rarely fits the way you work.

11:05 So you got to work around it.

11:06 And AI has actually changed that math.

11:09 It used to be you'd make the custom software or the SaaS software sort of work.

11:15 And now you're like, well, let's just build our own.

11:17 And building is easy, but keeping it simple, affordable,

11:20 and maintainable is not so easy.

11:22 And that's the problem that Longlink is trying to solve.

11:25 You write your business apps in plain Python with familiar libraries and standard development practices.

11:31 Longlink provides the platform underneath.

11:33 Authentication, permissions, development,

11:34 as time deployment, storage, routing,

11:37 logging, all taken care of for you.

11:38 You focus on the business logic.

11:40 Think purchase approvals, vendor onboarding,

11:43 work orders, and complaint tracking.

11:45 Start with one of these, build a nice custom version on top of Longlink, and move on to the next.

11:50 Getting started is just one command, uvx Longlink init.

11:54 The platform has a free tier, no credit card required.

11:57 The project is open source and in beta, and the team would really love for you to try it and share your feedback.

12:01 And while you're there over on GitHub, give them a GitHub star. Help them out.

12:04 Check out pythonbytes.fm/longlink to get started.

12:08 The link is in your podcast player's show notes.

12:12 Interesting they mentioned the complaint tracker.

12:16 Maybe those can get routed to dev null faster.

12:18 Exactly.

12:19 We'll be getting right back with you on that.

12:21 No problem.

12:22 Get right on that.

12:23 No problem at all.

12:24 I know I'm next in the show notes, but why don't we get over to you?

12:27 Yeah, we should do it correct, the correct order there.

12:30 So I've been a longtime person in the Python community,

12:33 and anyone who's been around long enough has probably used ModWisgi,

12:37 which is an open source project by Graham Dunpleton.

12:40 And he's got a new open source project that Simon Willison posted about on his blog recently

12:47 called Maru.

12:48 It is basically re-envisioning, re-imagining everything

12:53 that he has gone through in the last 20 years of maintaining and building ModWisgi,

12:58 what he would have wanted to do instead.

13:02 Because if you're in the, it's because ModWisgi, for those who don't know,

13:06 is an Apache module that lets you run Python applications

13:11 in the process space of Apache, which you can imagine comes with its own constraints.

13:16 So it was one of the big reasons why he was always kind of unhappy with ModWhiskey.

13:21 It was a great project, but he had pieces of it. He wishes he could have done differently,

13:25 but he couldn't because Apache dictates a lot of how their modules run in the module space.

13:30 And there's just not a lot you can do.

13:33 You've got a box and you've got to fit inside it. And

13:35 that's what ModWhiskey did.

13:36 They allowed to run, you know, Whiskey apps. So Maru is a new AI

13:39 I assisted a Rust server that allows you to run at edge Python applications,

13:45 which are WSGI or ASGI.

13:47 And actually they can be run side by side.

13:49 It can provide for zero failover.

13:51 And he provided a 19 post blog about how he did it.

13:58 And Simon links to all of them.

14:00 But it kicks off with 20 years of mod WSGI and what comes next.

14:03 So you can imagine someone who's done this in this domain,

14:07 in this space, has exactly the expertise you would need.

14:11 Basically go out and agentically engineer the better solution.

14:14 That's why this has happened now.

14:16 Two things happened in Graham's life.

14:18 He's semi-retired and agentic coding came about, which meant cost of producing software has dropped dramatically from a time standpoint.

14:26 So he was actually able to spend time as a hobby again, building the better version of what he wanted.

14:31 Yeah, this caught my attention for sure.

14:33 Yeah, I was really excited about it.

14:34 If you didn't cover it, I was thinking about covering it.

14:37 It was really exciting.

14:38 What's interesting is, yeah, he mentions in here kind of about the constraints of why he's doing this now,

14:44 what's going on, what,

14:46 you know, the Apache problems that he ran into and could never solve.

14:50 But it looks really cool.

14:51 And again, it's all AI code generated.

14:53 He gets to do all the pieces he wants to do and he documents the process along the way.

14:58 So if you're wanting to basically hear about how a very seasoned developer attacks a domain

15:03 that they know a tremendous amount of knowledge about and using AI to its fullest,

15:08 that they can be the design,

15:10 the architecture, the documentation,

15:12 the specs, the planning, and not worry about the

15:15 code, that's what you got here.

15:16 If you're not into AI generated code, maybe this isn't the project

15:20 for you, but I think this is the way projects like this should go is where you get someone

15:25 who is incredibly, again,

15:27 knowledgeable in that domain, guiding a tool like these AI agents

15:31 to build out the software that would be the best version

15:35 of the thing you'd ever wanted.

15:37 It does other cool things.

15:39 So like zero downtime releases, full traffic management,

15:42 like Canary and Blue Green releases.

15:45 Those are nice.

15:46 Yeah, so thinking about in the historic, like how we used to release software,

15:51 you would have to release the code someplace, Maybe you're releasing containers into Kubernetes,

15:55 but then you have to route traffic over to it.

15:57 Maybe you are just doing a git pull onto a machine with Apache, and now you got to restart the

16:02 process so that it can pick up your code changes.

16:05 This launches the containerized version of the code right into its own process,

16:09 handles that handover.

16:11 If your code fails to start, traffic never gets routed to it.

16:15 And that's just all bundled into this.

16:17 And again, another thing

16:19 he focused on was that same experience from the local developer.

16:23 You use this for local development, you use it in a daemon like a server,

16:28 or you can launch it into containers and have it has,

16:31 it's got three modes of running, which is like the Muru CTL run,

16:35 daemon start and serve, and all of them meant for specific different applications.

16:40 But obviously it supports Docker, Compose, Kubernetes,

16:43 and you've got the same process model across all three.

16:46 So fits my checkbox of I should be doing the same thing in Prada as I do in my local machine.

16:52 So it's easy to debug and I'm not running into weird deployment issues as I go into

16:56 another environment.

16:57 It's very appealing.

16:58 It's very, very appealing.

17:00 You know, the AI side doesn't turn me off from it.

17:03 Honestly, I have stories I'm going to share with you that will, I think, maybe be quite

17:08 the contrary.

17:09 Before we get to that, here's a guy who's got 20 years of experience.

17:12 I really wish I could rebuild this thing from scratch.

17:15 Now understanding 20 years of lessons.

17:18 But I just can't take the two years of like reprogramming this from scratch and then all the security stuff if I write it in native code and so on.

17:26 And then this partnership of, you know, Clotter, Codex or whatever,

17:30 plus exactly what they want to build.

17:32 I think that can be very powerful.

17:34 Yeah.

17:34 In addition to like the zero downtime releases,

17:37 it's everything you need for the front end too.

17:39 It's HTTP 1.1, 2, TLS,

17:42 there's virtual hosts.

17:43 It does all the bits the way you'd want it.

17:47 So it simplifies, actually simplifying your deployments.

17:49 You no longer need a separate static server.

17:52 Right, you don't need Nginx or whatever.

17:56 Less moving pieces is better in my book.

17:59 Only one piece move.

18:01 Exactly.

18:02 And if the pieces inside it don't start up correctly,

18:05 don't serve traffic to it.

18:06 Pieces rusted, don't try to move it.

18:08 Get a new piece.

18:09 Yeah.

18:10 And there's great docs, great code, great process.

18:14 The whole blog thing, just fantastic

18:16 to watch people develop in the open like that.

18:19 It's just funny because Graham's always said he's the grumpy old guy.

18:22 This is fantastic though.

18:23 Grumpy people don't do stuff like this.

18:25 No, it's very cool.

18:26 Very, very cool.

18:26 All right.

18:27 I've got one more thing for us.

18:29 And it's a follow-up from last week.

18:31 I told you all about DiskCache Oxide.

18:33 Well, Calvin.

18:34 Yes, I'm here for it.

18:36 I'm here for it.

18:37 I love it.

18:38 All right.

18:38 So one of the last main pieces, there's a few more things

18:42 before I call this DiskCache Oxide Project Feature Ready.

18:45 Just for reminders, everyone, Discache Oxide is a SQLite based,

18:50 but Python cache that has a very sophisticated Rust core for managing multi-threading background jobs that do like

19:01 management of the write-ahead log and checkpoints and all of these kinds of things,

19:05 expiration that is missing from a lot of these like simpler cache stories,

19:09 but you still run it as a single file in process.

19:13 So it has things, you know, like, I don't know,

19:16 800,000 requests, read, writes a second,

19:18 you know, in your app, which is very cool. But what it didn't have is it didn't

19:22 have the official like built in cache support for Django. So for those of you don't know,

19:29 Django, the framework itself has a way to read and write to caches with all the things that caches do.

19:36 And if you implement all the right bits, then you can swap that out with a Redis or Valkey

19:42 cache or whatever, right?

19:43 So I went and implemented that Django cache.

19:46 And now you can just go to the caches and set the default back into disk cache oxide.django

19:52 cache.

19:53 Give it a location and a timeout and you're off to the races.

19:56 Nice and easy.

19:57 Nice and easy.

19:58 You can set up page data caches and session caches as two separate things so that you're

20:04 We're not necessarily mixing those together, right?

20:07 You can also pass all the settings, like how large of a complete file size,

20:12 like how much space is this thing able to take up?

20:15 And then it'll start ejecting older things that are laying in there.

20:19 So if you're familiar with Django Cache, this is all pretty standard.

20:22 Let's see, do I have any numbers?

20:23 There we go.

20:24 Yeah, where's my performance numbers?

20:25 Here you are, Calvin.

20:26 Here you are.

20:28 I didn't say this, I don't believe, at the beginning, but I said it last week.

20:31 This is one of the things I'm very focused on is making sure this works perfectly in free-threaded Python

20:37 so you can scale out as much as you want without having to go to multiple processes.

20:42 But the graph here actually shows, what if I do a web garden where I have one,

20:46 two, four, eight processes?

20:48 And it compares against just the single-threaded, or not the single-threaded, the single-file cache.

20:55 And you can also do fan-out sharded caches, and you don't have to think about it.

20:59 You just say, I want eight separate files, and it'll manage all those connections and stuff for you.

21:03 And if you do that, you can get 1.43 million requests per second on just four worker processes,

21:11 as opposed to the meager 607,000 readwrites on the regular disk cache oxide one.

21:17 Compare this to, how does this look for like the traditional one?

21:21 So Django has a database cache SQLite version also that's like this one.

21:26 It does 262,000.

21:29 It's not shabby.

21:31 It's not.

21:31 I mean, that's very, very fast.

21:32 It's very fast.

21:33 It's still less than a quarter of what this does, you know what I mean, for the same amount of CPU.

21:38 It is a file-based one that does a little bit less than half of the database ones.

21:43 It was like 10x the file-based one.

21:45 Anyway.

21:45 Wow.

21:46 I feel like we need to see free-threaded Django with Django Ninja running with this disk cache oxide on top of Maru.

21:55 Yes.

21:56 Let's uncork it all.

21:57 Let's do it.

21:58 And there's also an example that you can work through that has like a whole sample code project you can download and write.

22:04 Yeah, I'm here for it.

22:06 Yeah, all right.

22:06 So that's pretty cool.

22:08 That's it.

22:09 That's super cool.

22:10 I believe I'm on extras today.

22:13 You got some extras.

22:14 I am extra free today.

22:17 Not extra, just regular.

22:19 Just regular Calvin.

22:20 No extra Calvin today.

22:21 It's been a week.

22:23 Yes, sometimes it is a week.

22:25 Yeah.

22:26 So today I unleashed Black Friday at Talk Python training and Talk Python itself.

22:33 So don't run very many sales over there.

22:35 You can get the everything bundle at 20%.

22:38 Yeah, about 20% off.

22:39 And for returning customers, there's further discounts on top of the 20%, you know, like

22:44 things.

22:44 So if you're looking at the courses over at Talk Python,

22:47 you can get all the courses for 20% off,

22:49 or I put together a special only Black Friday available bundle of something I'm calling

22:55 getting started with Python and programming in the age of AI.

22:58 I think that's a really good fit.

22:59 That's a steal.

23:00 That's a steal, Michael.

23:01 It's $65.

23:02 I know.

23:03 It's $65 for these four courses that form a perfect line of progression.

23:08 So Python for beginners gets you started on programming Python,

23:12 data structures, thinking through problem solving and breaking down problems

23:15 and just like the general programming beginners.

23:17 And then running with Git because if you're going to work with agents,

23:21 you really need to understand source control better than even regular programming.

23:25 And then Agente AI and Agente Python security.

23:29 So I think this is a really cool deal.

23:31 And like Calvin said, normally it'd be $156.

23:34 It's $65.

23:35 So get that.

23:36 Yeah, folks who are doing like the code mess advent calendar things,

23:40 there you go.

23:41 This will be a fun one.

23:42 Those are all some of my very favorite classes as well that we have.

23:45 Talk Python in production book, 25% off.

23:47 And if you want to do Talk Python membership, there's also a discount for all of those tiers as well.

23:53 So Black Friday, Talk Python.

23:54 please check it out. It really is a great way to get a discount and support the show.

23:58 Now, this is the part that I alluded to when we talked about the Muru. I found as part of my work,

24:05 I don't believe, no, it was definitely not on disk cache oxide.

24:08 It was on Chameleon RS, the Rust version of my re-implementation because none of these things work on free-threaded Python.

24:15 They're not tested on free-threaded Python.

24:16 People don't pay attention to it and it's really not great.

24:20 So I actually found a, maybe if you could put it in italics, a bug in CPython itself for

24:26 doing this free threaded work.

24:28 And so I submitted this as a bug report over to just the CPython

24:34 organization, Brittany Ray triaged it,

24:37 you know, there's a bit of a conversation.

24:39 And now there's this other thing, which I'm just now learning about, because this wasn't here last time I looked,

24:45 scaling with format. So here's, this is not a huge deal.

24:48 I'll just really quickly tell you that if you use format,

24:51 like string.format, or rather an fstring,

24:55 if you make the heinous mistake of saying, I want two decimal places,

25:00 instead of just, I just want the float.

25:03 No, I want the float with two decimal places.

25:05 It is six and a half times slower.

25:08 Only under free-threaded Python as you add threads.

25:11 And so I figured out sort of the differences.

25:14 So anyway, there's this issue that I submitted.

25:17 I did not do, did I put the PR?

25:19 I don't think so.

25:20 No, that's what they were working on.

25:21 I'm like, I don't think I put a PR here.

25:23 There is a PR, but I didn't write it because I wasn't like, I'm going to contribute to

25:26 CPython.

25:27 No, I'm just like, look, guys, this is.

25:28 Here it is.

25:29 It's so simple.

25:30 All you do is just do string dot format in a loop with free threading.

25:34 And if you put any sort of like two decimal places type of format or your toast become

25:38 serial again, which is crazy.

25:40 So anyway, as much as people say, oh,

25:42 these AIs just write a bunch of crap software that's bugs.

25:45 You know what?

25:45 They're really good at going.

25:47 Did you, did you notice this?

25:49 Not only is this not scaling the way we thought, but it's not scaling because of this string,

25:53 this F string.

25:54 That is insane to me.

25:55 So anyway.

25:56 They fixed it in 14 lines of code, Michael, including comments.

25:59 Do they already fix it?

26:00 Yeah, there's a fix in there.

26:03 Oh, there is a fix.

26:04 Yeah.

26:04 It's only two files changed.

26:05 Yeah, because the fix is actually not that hard.

26:09 The non-specified, I don't know what you call it when it doesn't have a spec.

26:13 It's just like curly, curly, a thing, you know?

26:15 That one just grabs onto a certain format designator or something.

26:21 But when you do it, if a specifier,

26:23 it all uses a lock and serializes down to like this other data structure before it goes back out.

26:28 So it's like, just do the way the other format is doing.

26:31 Don't, you know, it's pretty simple to fix,

26:33 but it's also just discovering it, right?

26:34 That's very cool.

26:35 All right.

26:35 Long Beach, Long Beach, California is calling you.

26:38 Calvin, I hope you can make it this year.

26:39 I won't.

26:40 I won't make it this year, unfortunately.

26:41 Oh my gosh.

26:43 Well, I'm going to be making it.

26:44 I'm going to be cruising around on my little scooter like I did last year.

26:46 That'd be cool.

26:47 You're talking about none other than PyCon 2027.

26:51 PyCon 2027 is announced.

26:53 Call for proposals are out.

26:54 That's interesting.

26:55 That's not why I'm telling you.

26:56 I'm telling you because there are dates on the calendar when you can reserve your opportunity to go to it.

27:01 And we had a lot of fun in Long Beach.

27:03 So hope to see you there.

27:04 And hopefully I can make it.

27:05 Chances are I will.

27:06 All right.

27:07 Really quickly, if you happen to run IntuneX, we spoke about this before,

27:10 the Mooru.

27:10 you should move, run yourself over to your server and patch it.

27:14 Let me tell you, oh my goodness.

27:18 Unauthenticated remote code execution with just a sweet little web request.

27:23 Is this, is they calling it Nginx to shell?

27:26 They are calling it, oh, it does have a name.

27:28 It is, no, it's Nginx to root.

27:31 To root.

27:31 Is his name.

27:32 All the other ones were like to shell.

27:34 Yeah, we already got to shell.

27:35 Nginx got to be different.

27:36 Yeah, yeah.

27:37 And this is actually, there's in this thing I'm linking,

27:39 there's only two vulnerabilities listed, but there's actually five CVEs that you need to patch.

27:45 So stay on top of it, folks.

27:47 If you're running out of the Docker Nginx container, the new one has it fixed.

27:50 But if you don't update your container, it's still the old one and it's not good.

27:54 So just if you're running Nginx, please pay attention to this.

27:57 Otherwise, don't worry about it.

27:58 Really quick, Lady Bird.

27:59 Are you familiar with Lady Bird?

28:01 Yes, I saw those in our post.

28:02 Someone mentioned it in Art Slack too.

28:04 Yeah, Lady Bird, the browser.

28:06 Could we have more than just Chrome and maybe Firefox?

28:09 you know what I mean yes someone else is building one and it's interesting this is from scratch I

28:14 think it's also in rust if I remember rust or go or something some memory safe native language if I

28:20 remember correctly but anyway it's an alpha you can go try it read the announcement and uh that's

28:24 it we're ready for an unnamed joke what do you think about that an unnamed joke oh I'm not even

28:30 right I'm not ready for this no I don't even know what to call it no actually it's just I didn't put

28:33 it in the show notes right so here's a a very fun picture oh I gotta log in so I'll just do it like

28:39 how tech people and AI people and just other, not just tech people,

28:43 but just how different groups of tech people see each other.

28:46 This is really fun.

28:47 So it's got a grid of software engineers, data scientists,

28:50 AI engineers, prompt engineers, and DevOps.

28:53 And then it has like the cross product of that.

28:55 So you can see what software engineers think of DevOps engineers.

28:59 It's not what my mom thinks I do, you know, what I actually do.

29:02 Unless your mom's a DevOps engineer, you don't know.

29:06 So like, for example, software engineers think of DevOps engineers as server babysitters.

29:12 Whereas, let's see, DevOps engineers think of software engineers as bug factories,

29:18 or the data scientists are GPU holders.

29:20 Accurate, accurate.

29:22 Software engineers perceive the prompt engineers as professional typists.

29:29 Data scientists, the AI engineers, model salesmen.

29:33 Oh, there's so many good ones here.

29:36 that's pretty good yeah the ai engineers see the software developers as the legacy keepers

29:40 and then so what do software developers see software developers as i can't see the diagonal

29:46 yeah yeah yeah they're real builders uh of course yeah let's go down the diagonal you're right we

29:50 got to go down the diagonal so software engineers see this is all how people see themselves software

29:54 engineers real builders data scientists math geniuses with like a normal distribution and

29:59 Einstein in the picture.

30:01 AI engineers are future builders.

30:03 Prompt engineers are AI whisperers.

30:06 And DevOps engineers are keeping it alive. And they're like a fireman's outfit.

30:11 That one's actually true.

30:13 That is true.

30:14 Prompt engineers see DevOps people as cloud wizards.

30:17 AI engineers is the launch crew.

30:19 Data scientists are the pipe fixtures.

30:20 And anyway, it's fun.

30:22 Nice.

30:23 That's awesome, Michael. Thank you for that.

30:25 Yeah, everyone check out this.

30:26 There's a lot of combinations you can go play with to enjoy this.

30:30 Well, I sure enjoyed it.

30:31 Calvin, thank you as always.

30:34 Yeah.

30:34 And thank you to Long Link for supporting the show.

30:36 And thank you to everyone out there who is listening.

30:39 You see him.


Want to go deeper? Check our courses




Subscribe to Python Bytes

⌂ Proxy