gh-152431: update StreamReader transport after StreamWriter.start_tls#152432
Conversation
Keep StreamReader in sync with the upgraded transport after StreamWriter.start_tls(), and add a regression test for the transport replacement.
|
Most changes to Python require a NEWS entry. Add one using the blurb_it web app or the blurb command-line tool. If this change has little impact on Python users, wait for a maintainer to apply the |
|
I think we can skip the news here :) |
|
This fixes a bug so it needs a news entry |
i added it . thank u! |
|
Thanks @kn1g78 for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
|
Thanks @kn1g78 for the PR, and @kumaraditya303 for merging it 🌮🎉.. I'm working now to backport this PR to: 3.15. |
|
GH-154629 is a backport of this pull request to the 3.14 branch. |
|
GH-154630 is a backport of this pull request to the 3.15 branch. |
Summary
After
StreamWriter.start_tls()upgrades a stream transport to TLS, theStreamWriterandStreamReaderProtocolare updated to use the new transport,but the linked
StreamReaderstill keeps the old transport.This change keeps the
StreamReadertransport in sync with the upgradedtransport.
Changes
StreamReaderProtocol._replace_transport()to also replace the linkedStreamReadertransportStreamWriter.start_tls()Issue
Testing
test_streamwriter_start_tls_updates_reader_transport