Skip to content

bpo-37404: Fix check for ssl.SSLSocket#17526

Closed
tiran wants to merge 1 commit into
python:masterfrom
tiran:bpo-37404-fix
Closed

bpo-37404: Fix check for ssl.SSLSocket#17526
tiran wants to merge 1 commit into
python:masterfrom
tiran:bpo-37404-fix

Conversation

@tiran

@tiran tiran commented Dec 9, 2019

Copy link
Copy Markdown
Member

Fix check for ssl.SSLSocket for Python builds without ssl support. The
check is now performed in debug module only so it does not slow down
production mode.

Fixes: https://bugs.python.org/issue39006
Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue37404

Fix check for ssl.SSLSocket for Python builds without ssl support. The
check is now performed in debug module only so it does not slow down
production mode.

Fixes: https://bugs.python.org/issue39006
Signed-off-by: Christian Heimes <christian@python.org>
@asvetlov

asvetlov commented Dec 9, 2019

Copy link
Copy Markdown
Contributor

@vstinner has another fix for this problem: #17524

I don't know what approach is better, both are satisfactory.
The only thing I want to mention is that I personally prefer to keep checks in release mode as well. In my experience, newbies very rarely run asyncio in debug mode. asyncio is hard enough, better to inform users quickly.
sock_* is an auxiliary API, most programs should use asyncio transports.
Maybe replacement isinstance(sock, ssl.SSLSocket) with type(sock) is ssl.SSLSocket withdraws objections about the performance?

@vstinner

vstinner commented Dec 9, 2019

Copy link
Copy Markdown
Member

I wrote a different fix: PR #17524.

You PR is different: you no longer check if the socket is a SSL socket is non-debug mode.

@vstinner

vstinner commented Dec 9, 2019

Copy link
Copy Markdown
Member

@asvetlov: "The only thing I want to mention is that I personally prefer to keep checks in release mode as well."

Ok, so I merged my PR instead, and I close this PR. Thanks @tiran anyway ;-)

@vstinner vstinner closed this Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants