Page de couverture de Python Bytes

Python Bytes

Python Bytes

Auteur(s): Michael Kennedy and Calvin Hendryx-Parker
Écouter gratuitement

À propos de cet audio
Python Bytes is a weekly podcast hosted by Michael Kennedy and Calvin Hendryx-Parker. The show is a short discussion on the headlines and noteworthy news in the Python, developer, and data science space.Copyright 2016-2026 Politique
Épisodes
  • #507 Something about security
    Dec 2 2026
    Topics covered in this episode: AI agents model CPython in Lean and produce 415 bug reportsAmazon Athena powered by DuckDB, now available in previewCitryPSF announces a Security RoadmapExtrasJokeWatch on YouTube Michael #1: AI agents model CPython in Lean and produce 415 bug reports David Andrews and Chao Zhang used AI agents to translate CPython 3.15.2 functions into Lean and check proofs about their behavior. Their November 13 post reports 4,067 accepted functions, 614,384 lines of Lean, and 415 bug reports, including about 55 involving crashes or memory corruption. Coverage is 14.3% of functions worth checking, not a fully verified interpreter. Multithreading is out of scope.Each model faces at least 50,000 differential test inputs, proofs, and review by a second agent before acceptance.A valid Lean proof can still describe the wrong model. Early reviews rejected weak properties that even broken functions could satisfy.415 reports does not mean 415 newly confirmed upstream bugs: some were already known, and remaining reports are being submitted.I asked what involvement the core team and CPython had with Project Glasswing. I think it was zero. It should be far more involved. Open someone reaches out to OSS Scanner. Calvin #2: Amazon Athena powered by DuckDB, now available in preview Remember when AWS bought DuckLabs? Here's what they built.Announced Dec 1, 2026 at re:Invent and in preview in 5 regions: us-east-1, us-east-2, us-west-2, eu-west-1 and ap-northeast-1.Athena's serverless query service now runs on DuckDB and splits a single query across many workers when the data outgrows one machine.AWS claims queries are up to 2x faster and up to 50% cheaper than Athena engine v3 on large datasets.Queries use DuckDB's SQL dialect and run against your existing Glue Data Catalog tables, so there's nothing to redefine and no data to move.Results can come back as Apache Arrow through a new streaming API and an ADBC driver, landing in data science tools with no conversion step.A new open-source Athena extension for DuckDB lets you prototype a query in local DuckDB and then run the same SQL on Athena at scale.Supports Apache Iceberg v3 and Parquet tables. To turn it on, create a workgroup or switch an existing one to DuckDB.Related: a separate Redshift extension for DuckDB (Apache 2.0, DuckDB v2.0.1) lets you query Redshift from a local DuckDB session and join the results with local Parquet or CSV files. Michael #3: Citry Citry's first stable release puts HTML templates, CSS, browser behavior and Python event handlers in one component class. Built by django-components maintainer Juro Oravec, it aims to give Python web developers Vue-style tooling without maintaining a separate frontend project. Clicks can call Python and replace the component's HTML. The editor catches template typos and wrong component inputs before someone opens the page. Run the checks in CI with citry check; useful feedback for humans and coding agents alike.Uses Vue for browser behavior, rather than eliminating JavaScript. Works with Django, FastAPI, Flask and other ASGI/WSGI apps.Author's error benchmark reports 56 of 61 applicable mistakes before runtime, including nine warnings. Four go undetected, including a secret sent to the browser.Author's speed test: 257 ms until usable for 1,400 entries on the second server load, empty browser cache, local M4 Mac/Chromium. Single-measurement charts, not a general speed ranking.1.x promises SemVer compatibility; citry-ui remains pre-1.0. django-components enters maintenance mode. Try the browser playground at https://citry.dev/playground/. Calvin #4: PSF announces a Security Roadmap The PSF's security plan for the coming year (posted Nov 30, 2026) has four focus areas: PyPI malware remediation, "compromise resilience" for PyPI and python.org, more capacity for vulnerability advisories, and post-quantum crypto readiness. Alpha-Omega and Anthropic fund the security staff.Malware: PyPI will lean more on automatic quarantine. Today it fires only when several trusted reporters flag the same project. It handled the Telnyx attack in April, about 2 hours after the first report and 3h 42m after upload. A new "Malware Triager" role will be able to handle reports without full PyPI admin access.Compromise resilience: the goal is for installers to reject tampered artifacts. How that works hasn't been decided, and several proposals are being evaluated. The PSF will also write a "Compromise Recovery Runbook" and test it regularly. A "Secure Python Distributions" program would check that redistributors verify python.org's Sigstore signatures.Vulnerabilities: the PSF says LLMs and agents are driving a sharp rise in known open-source vulnerabilities. The Python Security Response Team is handling about 4x more than a year ago. The PSF will evaluate making the PyPA advisory database the authoritative source, with maintainers able to correct entries.Post-quantum: a draft PEP targets the Python 3.16 feature window (...
    Voir plus Voir moins
    38 min
  • #506 Raft, Rust, and release day
    Nov 25 2026
    Topics covered in this episode: De-fanging dangerous triggers in GitHub Actions across an organizationRQlite - The fault-tolerant relational database built on SQLite.diskcache-oxide now supports DjangoMuru: an AI-assisted Rust server for Python apps from mod_wsgi's creatorExtrasJokeWatch on YouTube About the show Sponsored by LongLink: Open-source platform for building and running custom business applications with Python and FastAPI Connect with the hosts Michael: Mastodon / BlueSky / X / LinkedInCalvin: Mastodon / BlueSky / X / LinkedInShow: Mastodon / BlueSky / X 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 ...
    Voir plus Voir moins
    31 min
  • #505 Introducing diskcache-oxide
    Nov 17 2026
    Topics covered in this episode: tinyjobs: a SQLite job queue goes free-threadedfunkycache: cache Python functions in SQLiteGhostman - a keyboard-driven terminal API clientdiskcache-oxide: A shared, durable disk cacheExtrasJokeWatch on YouTube About the show Sponsored by LongLink: pythonbytes.fm/longlink Connect with the hosts Michael: Mastodon / BlueSky / X / LinkedInCalvin: Mastodon / BlueSky / X / LinkedInShow: Mastodon / BlueSky / X 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. Michael #1: tinyjobs: a SQLite job queue goes free-threaded tinyjobs is a Python job queue and cron scheduler that starts with a SQLite file and no dependencies. Switch the URL to Postgres or Redis without rewriting tasks. It runs async tasks natively, embeds workers in FastAPI, and plugs into Django 6's tasks framework. The creator's free-threading audit found four races hidden by the GIL. Background jobs without deploying a broker, plus a concrete case study in what removing the GIL exposes.The creator reports races in the task registry, codec cache, cross-thread flag and thread pool. hiredis can re-enable the GIL; the worker warns when it detects that.On 3.14t, --loops N runs event loops in separate threads. The author's laptop benchmark hit 42,000 async jobs/s with eight loops and two Redis instances, close to eight processes. SQLite rejects loops above one.Clock-skew lesson: two hosts 20 minutes apart duplicated 492 of 3,000 jobs on 0.7.0. Using Redis server time fixed that test, not the general exactly-once problem.Author's SQLite measurements: about 572 jobs/s end-to-end; a 20,000-job burst drained in four seconds. Synthetic workloads and different harnesses, not interchangeable throughput claims.At-least-once delivery still requires idempotent tasks. Python 3.12+; young project, with the README now listing v0.11.0 versus the email's v0.9.0. Docker setup: services: web: build: . command: uvicorn main:api --host 0.0.0.0 volumes: [jobs:/data] worker: build: . command: tinyjobs worker --app tasks:app --shutdown-timeout 25 stop_grace_period: 40s volumes: [jobs:/data] volumes: jobs: external: true Calvin #2: funkycache: cache Python functions in SQLite Alex Chan's functools.cache-style decorator stores results in SQLite, so they survive after the process exits. He built it to speed up his static site build.It's released on PyPI: funkycache 1.0.4, from November 15. The first release, 1.0.0, came out November 7. It needs Python 3.14+ and depends on pydantic and xxhash.Usage: cache = FunkyCache(storage="sqlite"), then @cache.register(files=[...], values=[...]). A cache entry is invalidated when the function's source file changes or when any listed file or value changes, such as a library version.Return values go through Pydantic's TypeAdapter, based on the return type hint, so it only works on typed code.Generators get special handling. functools.cache hands every caller the same generator object. funkycache saves the output as a list and gives each caller a fresh iterator, up to a soft memory limit.Cache keys are JSON hashed with XXH64. They're deliberately lossy, and that's fine because nothing reads the original arguments back out of a key.The design notes are a good segment on their own: the author had used MD5 because they "conflated weak with fast," and in their limited testing JSON was faster than pickle and easier to debug.With a warm cache the site builds in about half a second, and the library is only a few hundred lines including tests. It doesn't watch files on purpose, to stay small. Calvin #3: Ghostman - a keyboard-driven terminal API client A local-first Postman alternative that runs in the terminal, with no cloud account required. It's MIT licensed and was featured in PyCoder's Weekly #760.It's released on PyPI: pip install ghostman, then run ghostman. The current version is 0.1.8, from November 3. The first release, 0.1.0, came out October 31. It needs Python 3.10+.It's built on Textual, httpx and Rich, so it's pure Python under the hood.It sends GET, POST, PUT, DELETE and PATCH requests, shows DNS and time-to-first-byte timing live, and colors JSON responses automatically.A built-in webhook inspector: Ctrl+W starts a listener on port 9090. Captured payloads show headers and timestamps, and you can load one straight into the request editor.Collections are plain JSON/YAML files you can commit to Git. The README gives two different folders for them (.ghostman/ and ~/.ghostman/).It's fully keyboard-driven: Ctrl+S sends, Ctrl+K saves, Ctrl+N starts a new request, Ctrl+Q quits.The author claims about 30MB of RAM and a cold start of about 150ms; I haven't checked either number. It's a young project, with 158 stars and 15 commits. ...
    Voir plus Voir moins
    40 min
adbl_web_anon_alc_button_suppression_t1
Pas encore de commentaire