Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

start_tls() loses buffered data and doesn't work when upgrading a stream

Open
#707 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
networking

Research direction

Start with StreamWriter.start_tls() and loop.start_tls(), then read the linked CPython issue and proposed pull request for the intended behavior. Done means upgrading a mid-stream connection without losing data already buffered in StreamReader and without the call hanging forever.

Written by the indexing model from the issue text.

Description

When using StreamWriter.start_tls() (or loop.start_tls()) to upgrade a connection to TLS mid-stream, any data already buffered in the StreamReader is lost, and the call hangs forever.

The problem is present in asyncio too: https://github.com/python/cpython/issues/142352 , and a solution has been provided: https://github.com/python/cpython/pull/142354

Dominant language
Cython
Stars
11.9k
Forks
615
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from MagicStack/uvloop

All issues in MagicStack/uvloop

Similar issues

More Networking issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.