Skip to content

adewale/python-workers-issues

Repository files navigation

Python Workers Issues

Self-contained reproductions of Python Workers bugs. Each numbered directory is an independent project that demonstrates a specific issue and its workaround or, after an upstream fix lands, serves as a regression test.

Get started

  1. git clone https://github.com/cloudflare/python-workers-issues
  2. cd into an issue directory (e.g. cd 2-fastapi-r2-streaming)
  3. uv run pywrangler dev
  4. Press the b key to open a browser tab and make a request to the Worker

Active Issues

  • 3-httpx-headers/ — The pywrangler-bundled httpx replaces httpcore with a jsfetch.py transport that strips the User-Agent header to avoid browser CORS preflights. Workers aren't browsers — this causes 403s from APIs like GitHub that require User-Agent. Workaround: use js.fetch() directly.
  • 4-r2-large-binary-roundtrip/ — Returning large R2 objects (>~10MB) through a Python ASGI response crashes the Worker. The data crosses the Pyodide FFI boundary twice (JS→Python→JS), doubling memory usage in Wasm linear memory. Workaround: bypass Python by passing R2's body ReadableStream directly to a JS Response.

Resolved Issues

  • 2-fastapi-r2-streaming/ — Fixed by adding workers-runtime-sdk>=1.1.1. The Workers ASGI adapter now consumes all chunks from StreamingResponse async generators instead of truncating R2 content after the first chunk.

Verified Behaviors

  • 5-sync-http-libraries/requests and urllib3 can make synchronous outbound HTTP requests from Python Workers handlers.

Open Beta and Limits

  • Python Workers are in open beta. You can use packages in your Workers by using the pywrangler tool.
  • You must add the python_workers compatibility flag to your Worker while Python Workers are in open beta.

We'd love your feedback. Join the #python-workers channel in the Cloudflare Developers Discord and let us know what you'd like to see next.

License

The Apache 2.0 license.

About

Self-contained reproductions of Python Workers bugs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages