FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-158313: Clear the OpenSSL error queue when ssl raises OSError by lazerg · Pull Request #158333 · python/cpython · GitHub

Repository navigation

gh-158313: Clear the OpenSSL error queue when ssl raises OSError - #158333

Open
lazerg wants to merge 1 commit into
python:mainfrom
lazerg:fix-issue-158313
Open

lazerg wants to merge 1 commit into
python:mainfrom
lazerg:fix-issue-158313

Conversation

lazerg commented Sep 28, 2026 •
edited by bedevere-app Bot
Loading

Copy link
Copy Markdown
Contributor

The two ERR_LIB_SYS branches in PySSL_SetError return early and skip the ERR_clear_error() call that every other path makes. The entry then stays on the thread's error queue, and SSL_get_error() picks it up on the next I/O call on any socket in that thread, so the same OSError is raised again and again. This clears the queue in both branches, like the e == 0 branch already does.

The test fails on main with BrokenPipeError from the second connection.

Fixes #158313

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ssl: PySSL_SetError leaves the ERR_LIB_SYS entry on the OpenSSL error queue, so every later SSL I/O on that thread fails with the same OSError

1 participant


Back | FazBrowse Home | New Git URL