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

Enable type checking for Trio #69

Merged
merged 1 commit into from
May 2, 2020
Merged

Enable type checking for Trio #69

merged 1 commit into from
May 2, 2020

Conversation

JayH5
Copy link
Member

@JayH5 JayH5 commented May 1, 2020

Using trio-typing

self.stream, ssl_context=ssl_context, server_hostname=hostname
self.stream,
ssl_context=ssl_context,
server_hostname=hostname.decode("ascii"),
Copy link
Member Author

Choose a reason for hiding this comment

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

This wasn't actually a bug I think because the SSLContext always encodes the hostname:
https://github.com/python/cpython/blob/7b3ab5921fa25ed8b97b6296f97c5c78aacf5447/Lib/ssl.py#L486-L492

...but lot's of things (including the typeshed definitions of the stdlib SSLContext) type the hostname as Optional[str]. And we decode with ascii in the asyncio backend as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds fair enough 👍

Copy link
Contributor

@yeraydiazdiaz yeraydiazdiaz left a comment

Choose a reason for hiding this comment

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

Nice one 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants