Skip to content
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

Change conn.conn_kw's content instead of replacing it #16587

Merged
merged 3 commits into from
Feb 8, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,7 @@ def get_connection(self, url, proxies=None):
conn = super(BiggerBlockSizeHTTPAdapter, self).get_connection(url, proxies)
system_version = tuple(sys.version_info)[:3]
if system_version[:2] >= (3, 7):
if not conn.conn_kw:
conne.conn_kw = {}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, conn.conn_kw will never be None as it is created from a function kwargs:

https://github.com/urllib3/urllib3/blob/67111020d9cfc5798bc85f3719b3015e3ff28692/src/urllib3/connectionpool.py#L167

    def __init__(
        self,
        ...
        **conn_kw,

and saved as an attribute later:

https://github.com/urllib3/urllib3/blob/67111020d9cfc5798bc85f3719b3015e3ff28692/src/urllib3/connectionpool.py#L195

        self.conn_kw = conn_kw

conn.conn_kw['blocksize'] = 32768
return conn