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

gh-131878: Fix input of unicode characters with two or more code points in the REPL on Windows in vt mode by chris-eibl · Pull Request #133030 · python/cpython · GitHub

/ cpython Public

gh-131878: Fix input of unicode characters with two or more code points in the REPL on Windows in vt mode - #133030

Closed
chris-eibl wants to merge 5 commits into
python:mainfrom
chris-eibl:fix_vt_windows
Closed

gh-131878: Fix input of unicode characters with two or more code points in the REPL on Windows in vt mode#133030
chris-eibl wants to merge 5 commits into
python:mainfrom
chris-eibl:fix_vt_windows

Conversation

chris-eibl commented Apr 26, 2025
edited
Loading

Copy link
Copy Markdown
Member

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 = char if isinstance(char, int) else ord(char)
        char = bytes(bytearray((ord_char,)))

Maybe too much churn, thus just a draft.

elif self.__vt_support:
# If virtual terminal is enabled, scanning VT sequences
self.event_queue.push(rec.Event.KeyEvent.uChar.UnicodeChar)
for char in raw_key.encode(self.event_queue.encoding,

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

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

Copy link
Copy Markdown
Contributor

I like this proposal.

Copy link
Copy Markdown
Member Author

Closing since #131901 is merged and backported.

chris-eibl closed this May 6, 2025
chris-eibl deleted the fix_vt_windows branch May 6, 2025 03:59
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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL