Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

improvement: patch urllib in bootstrap to support networking (#934)

Akshay Agrawal34f816196e94
diff --git a/frontend/src/core/pyodide/worker/bootstrap.ts b/frontend/src/core/pyodide/worker/bootstrap.ts
index 4675b2b181..6b0d901c64 100644
--- a/frontend/src/core/pyodide/worker/bootstrap.ts
+++ b/frontend/src/core/pyodide/worker/bootstrap.ts
@@ -41,11 +41,18 @@ export async function bootstrap() {
"${marimoWheel}",
"markdown",
"pymdown-extensions",
+ "pyodide_http",
],
deps=False
);
`);
+ // Patch the built-in urllib
+ pyodide.runPython(`
+ import pyodide_http
+ pyodide_http.patch_urllib()
+ `);
+
return pyodide;
}