Skip to content

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

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

Closed
wants to merge 1 commit into from

Conversation

tiran
Copy link
Member

@tiran tiran commented Dec 9, 2019

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
Copy link
Contributor

asvetlov commented Dec 9, 2019

@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
Copy link
Member

vstinner commented Dec 9, 2019

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
Copy link
Member

vstinner commented Dec 9, 2019

@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