Skip to content

Conversation

@chris-eibl
Copy link
Member

@chris-eiblchris-eibl commented Apr 26, 2025

ab8efa7 is the fix on top of the reverted #130805.

49078f3 shows how I'd like to only accept bytes of length=1 in BaseEventQueue.push().

Only the tests used the int code path somewhat non-transparent by using strings which got converted to due to else ord(char) to bytes of length=1 again:

ord_char=charifisinstance(char, int) elseord(char) char=bytes(bytearray((ord_char,)))

Maybe too much churn, thus just a draft.

elifself.__vt_support:
# If virtual terminal is enabled, scanning VT sequences
self.event_queue.push(rec.Event.KeyEvent.uChar.UnicodeChar)
forcharinraw_key.encode(self.event_queue.encoding,
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd love to use PEP-467iterbytes() here :)

@sergey-miryanov
Copy link
Contributor

I like this proposal.

@chris-eibl
Copy link
MemberAuthor

Closing since #131901 is merged and backported.

@chris-eiblchris-eibl deleted the fix_vt_windows branch May 6, 2025 03:59
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@chris-eibl@sergey-miryanov