Skip to content

Conversation

@rpwagner
Copy link

As discussed in #2514, urllib.request is not supported in WebAssembly. This replaces urllib.request where needed with urllib3 which does work with WebAssembly. I've tried to keep the code changes to a minimum and to reuse existing semantic patterns.

The linter did introduce new lines in one of the imports. I found it odd but left it in place.

Rationale

This enables the use of Cartopy is Pyodide and JupyterLite. Without it, downloading of shape files, etc., fail. See #2514.

Implications

I've run the unit tests and nothing new fails. It's also been tested in JupyterLite and works. There is a chance that the download code path hasn't been fully tested and something may still need to be changed to support urllib3.

This also introduces a new dependency, even though urllib3 is widely available. It is also an existing package in Pyodide.

@CLAassistant
Copy link

CLAassistant commented Mar 29, 2025

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants