%load doesn't work as hoped on https
Trying to get this to work
%load https://raw.githubusercontent.com/MicrosoftDocs/mslearn-introduction-to-machine-learning/main/graphing.py
I get an error:
/tmp/xeus-python-kernel/envs/xeus-python-kernel/lib/python3.10/urllib/request.py in unknown_open(self, req)
1417 def unknown_open(self, req):
1418 type = req.type
-> 1419 raise URLError('unknown url type: %s' % type)
1420
1421 def parse_keqv_list(l):
URLError: <urlopen error unknown url type: https>
is it a limitation ? is there a simple workaround ? (via javascript alternative ?)
ok, found there the mother jupyterlite issue .. which is a pyodide temporary limitation https://github.com/jupyterlite/jupyterlite/issues/919
suggestion one made is:
from js import fetch
suggestion two is:
import pyodide_http
pyodide_http.patch_all()
would it be possible to include pyodide-http ?

maybe it's a temporary workaround, so don't know if it's sane to be done.
Your last two comments are very specific to pyodide, unfortunately that won't help in the case of xeus-python.
We will probably need a mock module for urllib/request similar to what we did for requests in https://github.com/emscripten-forge/requests-wasm-polyfill. Maybe a new https://github.com/emscripten-forge/urllib-wasm-polyfill package which uses a similar approach. Maybe @DerThorsten have thought about this before?
Using the latest jupyterlite-xeus version, you can now install the requests package and use it:
name: xeus-kernels
channels:
- https://repo.mamba.pm/emscripten-forge
- conda-forge
dependencies:
- xeus-python
- requests
Though %load is still not working because it uses urlllib