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
Support Python Without SSL #320
Comments
So, does a relative import in that file fix this problem? |
urllib3 should definitely work without ssl—there is much code written to allow this. A fix for this is very desirable. :) |
Yea, looks like changing that to |
Anyone interested in doing this fix? Would be nice if we could get a test for |
I am interested but also moving out of my apartment this weekend and Kevin Burke | Twilio On Fri, Jan 24, 2014 at 12:41 PM, Andrey Petrov notifications@github.comwrote:
|
I think having a test that raises an |
I would like to write the test for this tonight. If anyone gets around to trying it before me, they should look into inserting a Finder object into |
FWIW Python itself has some tests that do this I think... Not sure how they do it though. |
I spent a few hours doing more research into this. To say the least, this is far less simple than I thought. Trying to patch from unittest import mock
with mock.patch('builtins.__import__', side_effect=ImportError):
import ssl
print(ssl) That of course will raise an |
I think we should go ahead and push @Lukasa's fix even if we can't get the mocking correct. Like @shazow said a lot of code is written to ensure that urllib3 works without This appears to only affect various versions of Python3 (fails for me on Python3.3 and @dstufft for Python3.4) but works for my Python2.7. Even if we can't get a test I was able to mock not having I also probably went down the same path as @sigmavirus24 and tried to patch |
Happy to merge a fix. Is there a PR somewhere I'm missing? I agree that while a test would definitely be nice to have, I don't want to block on it in this scenario. |
Just submitted one. |
Woohoo merged. |
Right now it's impossible to use urllib3 from a Python that was compiled without SSL. Ideally urllib3 would still continue to function, but if you tried to do something that required the ssl module it would then bail. This would allow pip to support a limited set of functionality on non SSL Pythons.
The text was updated successfully, but these errors were encountered: