Skip to content

Enable type checking for Trio - #69

Merged
JayH5 merged 1 commit into
masterfrom
jamie/trio-typing
May 2, 2020
Merged

Enable type checking for Trio#69
JayH5 merged 1 commit into
masterfrom
jamie/trio-typing

Conversation

@JayH5

@JayH5JayH5 commented May 1, 2020

Copy link
Copy Markdown
Contributor

self.stream, ssl_context=ssl_context, server_hostname=hostname
self.stream,
ssl_context=ssl_context,
server_hostname=hostname.decode("ascii"),

Copy link
Copy Markdown
ContributorAuthor

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

Choose a reason for hiding this comment

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

Sounds fair enough 👍

@yeraydiazdiazyeraydiazdiaz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice one 👍

@JayH5
JayH5 merged commit be8735b into masterMay 2, 2020
@JayH5
JayH5 deleted the jamie/trio-typing branch May 2, 2020 08:32
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@JayH5@yeraydiazdiaz