Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integrate functionality into urllib3 #28

Open
sethmlarson opened this issue Mar 28, 2023 · 4 comments
Open

Integrate functionality into urllib3 #28

sethmlarson opened this issue Mar 28, 2023 · 4 comments

Comments

@sethmlarson
Copy link

馃憢 Hey, thanks for creating this project! When PyScript was announced at PyCon US 2022 I immediately tried to add support for synchronous HTTP requests w/ PyScript into urllib3 but was unfortunately unsuccessful at the time. I can see that support for this has grown since that time 馃殌

I wanted to ask what you were thinking long-term for this project, if you'd like to land support for PyScript into urllib3 natively (and thus, many packages depending on urllib3/Requests would immediately be able to take advantage) versus the current patching approach. Let me know your thoughts on this.

Again, thanks much!

@koenvo
Copy link
Owner

koenvo commented Mar 28, 2023

Hi Seth! Thanks for the kind works!

With the release of PyScript.com the adoption of PyScript / Pyodide seems to be better and better. This is an awesome development as it makes it easier for people to start learning Python in an environment that doesn't require all kind of ops skills ("it's not working in my venv" etc).

A logical step forward was to make network requests possible. My idea was to create a patch so people can get start going without updating core libraries (like urllib3). The patch approach makes it also possible to use older installations/packages that won't get updates often.

Nevertheless I believe the next step would be to update the core libraries like urllib3 to be compatible with PyScript. It would be a great step forwards when people don't have to use the pyodide-http package, but "it just works". Happy to help where possible.

Thanks for your message!

@dberardo-com
Copy link

thanks for the work you are all doing ... i am indeed using this package somewhere else, and i get this error at one point:

File "/lib/python3.11/site-packages/urllib3/connection.py", line 186, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x46e6e70>: Failed to establish a new connection: [Errno 50] Protocol not available

i am assuming that this has the same cause of what is highlighted in this issue right ?

@sethmlarson
Copy link
Author

@dberardo-com That is indeed the error message for this feature request.

@dberardo-com
Copy link

i am looking forward to see that fixed, i am using pyodide no nodejs backend and where i cannot get with it, i would like to "outsource" the tasks to a docker container. but docker python API relies on HTTP / urllib calls (same goes for k8s btw) and so i am kinda stuck ...

that would be a great "bridge-solution" while awaiting for more and more pyodide functionalities to come, and perhaps no need of using docker anymore for such use cases

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

No branches or pull requests

3 participants