-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fall back on requests module when urllib fails to load a URL #8667
Conversation
This can happen on systems where OpenSSL is too old.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use requests
to start with? It's the recommended way to do HTTP requests in python.
If it is a dependency issue, maybe fall back to urllib
instead of the other way around?
tools/system_libs.py
Outdated
data = f.read() | ||
except URLError as e: | ||
try: | ||
import requests |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
may be worth a comment that requests
is used as a workaround for an older python?
@quantum5 Is |
Unfortunately, |
The problem is that we don't have any way today to use modules not part the standard library because we don't yet have any way to run any "install" or "post check-out" step before emscripten is expected to be functionally. For the same reason we don't have any git sub-modules yes. Once we improve the emsdk emscripten packaging story I think we can introduce some kind of "post-sync" step that git developers are expected to run, and then have this performes as part of the emsdk packaging (perhaps included in the emscripten release tar balls). |
Maybe an alternative to consider is to use |
Sure. From my POV, it not so much about the specific command that needs to run, more about how to enforce that developers run that command to stay up-to-date. Emscripten is a strange mix since we are have both python and node module dependencies in the same tree. The npm people want to be able to to do Node developers are used to running |
…ten-core#8667) This can happen on systems where OpenSSL is too old.
I'm a little worried that this means we need to run out tests on both with and without the requests module. A recent bug that does use the requests module: #11283 I this still needed? I don't see the original bug that triggered this change? I wonder if we can revert it now. Having all those different methods seems like a bad idea. |
…ten-core#8667) This can happen on systems where OpenSSL is too old.
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
It turns out that the www.ijg.org refused requests from the urllib library for some reason. This issues was being masked by the fact that system_libs.py prefers to use `requests` when it is installed. This change undoes that. This feature was originally added in #8667 to deal with older python installations but these days we supply our own python as part of emsdk so we should be able to depend on a recent/correct version. Having the fallback here just makes testing harder. Fixes: #13869
This can happen on systems where OpenSSL is too old.