Proposal: Make start_tls a method on streams & return a new stream#484
Merged
Conversation
JayH5
commented
Oct 19, 2019
yeraydiazdiaz
requested review from
florimondmanca,
lovelydinosaur and
sethmlarson
October 19, 2019 10:03
florimondmanca
left a comment
Contributor
There was a problem hiding this comment.
Very nice change! There's just the timeout question to be resolved (see the comment I left), but overall this is looking really good. Great to see this change fixes the 3.8 build! 👏
sethmlarson
approved these changes
Oct 19, 2019
sethmlarson
left a comment
Contributor
There was a problem hiding this comment.
This looks good overall to me, leaving to others for more specific comments. :)
florimondmanca
approved these changes
Oct 19, 2019
Contributor
|
🎉 Thank you so much @JayH5! |
Kludex
referenced
this pull request
in pydantic/httpx2
May 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes Python 3.8.0 TLS issue (see second commit & #477)
I like this approach better than mutating the insides of a
TCPStreamwhen switching to TLS. Instead, a newTCPStreaminstance is returned. This pattern better matches the way Trio abstracts streams which also seems to be the way asyncio is headed for Python 3.next.Fixing the Python 3.8 issue does not require this refactor, but this makes the fix a lot cleaner.