◐ Shell
clean mode source ↗

Fix Drop to prevent TLS data loss by youknowone · Pull Request #6825 · RustPython/RustPython

Remove pending_tls_output.clear() from Drop implementation.

SSLSocket._real_close() in Python doesn't call shutdown() before
closing - it just sets _sslobj = None. This means pending TLS data
in the output buffer may not have been flushed to the socket yet.
Clearing this buffer in Drop causes data loss, resulting in empty
HTTP responses (test_socketserver failure on Windows).

The explicit clearing is also unnecessary since all struct fields
are automatically freed when the struct is dropped.

@youknowone marked this pull request as ready for review

January 21, 2026 08:16