-
Notifications
You must be signed in to change notification settings - Fork 21
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
RecursionError when SSLContext imported from urllib3 #121
Comments
Hi @nateprewitt -- we've documented that This means that it generally won't work well if a library tries to use I get that this is not particularly convenient. (And we should clearly have a look at your reproduction case to see if we can at least fail out in a better way than a recursion error.) Ideas welcome. |
Hi @davisagli! Yeah, I spoke with Seth about this on Discord. I agree this behavior is already documented, I think the issue is coming in where 3p libraries are calling I'll let Seth expand on his thoughts, but it sounds like this may just be updating docs. It sounds like arcgis' use case may not be intended to be supported but it would be great if there's a clearer way to surface an error when we're in this failure state. |
Yeah this is an issue with arcgis' usage, we should be guiding library maintainers to not use |
This issue actually makes me wonder if we should deprecate |
@sethmlarson Just spitballing here: show a warning if it's called from a module that is not named |
We recently encountered an interesting interaction with boto3 and arcgis due to arcgis' adoption of
truststore
(boto/boto3#3912). Boto3 has existing usage of the SSLContext fromurllib3.utils.ssl_
to work around historical issues with pyopenssl. Most of that no longer exists, but the imports/behaviors are left in place for backwards compatibility.When
truststore.inject_into_ssl()
is called, it's currently patching the SSLContext referenced in urllib3 resulting in aRecusionError
depending on the order these operations are performed. I've created a minimal repro with only Truststore and urllib3.Minimal Reproduction
This issue is avoided if the
truststore
injection is done first. This is fine for code you control, but becomes more complicated to root cause when a module usingtruststore
is imported later in user code.Environment details
Original report is for Windows and Python 3.11.5, I've also repro'd on macOS 13.5.2 with Python 3.11.5.
urllib3==2.0.7
truststore==0.8.0
The text was updated successfully, but these errors were encountered: