Change conn.conn_kw's content instead of replacing it - #16587
Conversation
|
This pull request is protected by Check Enforcer. What is Check Enforcer?Check Enforcer helps ensure all pull requests are covered by at least one check-run (typically an Azure Pipeline). When all check-runs associated with this pull request pass then Check Enforcer itself will pass. Why am I getting this message?You are getting this message because Check Enforcer did not detect any check-runs being associated with this pull request within five minutes. This may indicate that your pull request is not covered by any pipelines and so Check Enforcer is correctly blocking the pull request being merged. What should I do now?If the check-enforcer check-run is not passing and all other check-runs associated with this PR are passing (excluding license-cla) then you could try telling Check Enforcer to evaluate your pull request again. You can do this by adding a comment to this pull request as follows: What if I am onboarding a new service?Often, new services do not have validation pipelines associated with them, in order to bootstrap pipelines for a new service, you can issue the following command as a pull request comment: |
| if not conn.conn_kw: | ||
| conne.conn_kw = {} |
There was a problem hiding this comment.
Actually, conn.conn_kw will never be None as it is created from a function kwargs:
def __init__(
self,
...
**conn_kw,and saved as an attribute later:
self.conn_kw = conn_kw
Symptom
Python SDK fails when an HTTPS proxy is used:
Root cause
#14442 replaces
conn.conn_kwwith a newdict.It corrupts the internal logic of
urllib3, asconn.conn_kwis not empty. Replacing it causes existing key-values to be discarded.Example
conn.conn_kwwhen proxy is used:{ 'socket_options': [], 'proxy': Url(scheme='https', auth=None, host='127.0.0.1', port=8888, path=None, query=None, fragment=None), 'proxy_config': ProxyConfig(ssl_context=None, use_forwarding_for_https=False) }The above error happens because
proxy_configfromconn.conn_kwis discarded.Change
This PR changes
conn.conn_kw's content instead of replacing it, so that existing values are preserved.