Skip to content

gh-145886: remove unused Event.raw field from _pyrepl#146097

Open
HCYT wants to merge 4 commits intopython:mainfrom
HCYT:fix-gh-145886
Open

gh-145886: remove unused Event.raw field from _pyrepl#146097
HCYT wants to merge 4 commits intopython:mainfrom
HCYT:fix-gh-145886

Conversation

@HCYT
Copy link

@HCYT HCYT commented Mar 18, 2026

While looking at the getpending() bug (e.raw += e.raw instead of e2.raw), I noticed Event.raw is never actually read anywhere -- only written to. So instead of just fixing the typo, this removes the dead field entirely.

Removed raw: bytes = b"" from the Event dataclass along with all related assignments in unix_console.py, windows_console.py, and base_eventqueue.py. The flush_buf() calls are kept since they still need to clear the internal buffer, just no longer pass the result to Event.

Tests updated to match.

HCYT added 2 commits March 18, 2026 11:36
Event.raw was being accumulated in getpending() but never actually
read anywhere -- the callers only ever use Event.data. On top of that,
there was a copy-paste bug (e.raw += e.raw instead of e.raw += e2.raw)
which went unnoticed precisely because nothing consumes the field.

Rather than just fixing the typo, remove the dead field entirely.
missed one with positional raw arg, only runs on windows so
the previous test run didn't catch it
@python-cla-bot
Copy link

python-cla-bot bot commented Mar 18, 2026

All commit authors signed the Contributor License Agreement.

CLA signed

@bedevere-app
Copy link

bedevere-app bot commented Mar 18, 2026

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 skip news label instead.

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.

1 participant