-
Notifications
You must be signed in to change notification settings - Fork 742
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
urllib3 connection pool rewrite breaks requests #824
Comments
delete requests connectionpool override, Autorest Issue Azure#824
Add @annatisch @lmazuel for comments |
Urgh... yes this is the ugly work around for the test workflow... |
@annatisch is this fixed? Can this issue be closed? |
While the updated package hasn't yet been published to PyPI, the fix has been merged to master, so can probably be closed :) |
Sounds good. I'll close it. Thank you for submitting the issue, @glamdisju. Thank you for fixing it, @annatisch. |
Hello
I've been testing testing some code that automatically deploys to Azure when I noticed a strange behaviour, whenever an msrest package was imported, my requests calls stopped working.
I'm using Python 3.4.3 on Linux, package versions are:
msrest 0.1.1
msrestazure 0.1.1
The Minimal code that produces the error:
I've been tracing why this was happening and arrived to autorest/ClientRuntimes/Python/msrest/msrest/pipeline.py:406
You can see that retries is set by default to None and then the if checks the attribute directly, that seems odd to me, either make the retries mandatory or check with hasattr that it exists.
However this should not affect my code, but on the same file pipeline.py we find that the code is directly changing values in urllib3:
Accesing the pool_classes_by_scheme directly does not seems to be very object oriented and has the nasty effect of overriding ANY http connection made by requests. The code is executed at module level, so simply importing executes the override.
I'm trying to bypass this effect but using requests Sessions has not been effective. I'm planning on saving the variable pool_classes_by_scheme before and after the import and switch it as needed, but this is very ugly code.
I'm not very familiar with urllib3 but there must be a way to apply the custom pool/adapter/whatever only to azure urls and leave the others trough the default pool/adapter/whatever
The text was updated successfully, but these errors were encountered: