GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — 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

Conversation

@chris-eibl

@chris-eibl chris-eibl commented Apr 26, 2025 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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.

  • Issue: New REPL on Windows exits when accented character is pasted/typed #131878

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
chris-eibl added 3 commits April 26, 2025 23:08
@chris-eibl
Revert "pythongh-130804: Fix support of typing unicode chars in pyrepl (
a06c42a
python#130805)"

This reverts commit 7c98b06.
@chris-eibl
fix vt on Windows
ab8efa7
@chris-eibl
only accept bytes of length=1 in BaseEventQueue.push()
49078f3
@bedevere-app bedevere-app Bot mentioned this pull request Apr 26, 2025
New REPL on Windows exits when accented character is pasted/typed #131878
Closed
@chris-eibl chris-eibl mentioned this pull request Apr 26, 2025
gh-131878: Fix input of unicode characters with two or more code points in new pyrepl on Windows #131901
Merged
chris-eibl added 2 commits April 27, 2025 00:38
@chris-eibl
remove unused push_char occurrences
f430f31
@chris-eibl
self.push(_c.to_bytes())
6fe04a5
chris-eibl
chris-eibl commented Apr 26, 2025
View reviewed changes
Comment thread Lib/_pyrepl/windows_console.py
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,

@chris-eibl chris-eibl Apr 26, 2025

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

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-467 iterbytes() here :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

sergey-miryanov reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@sergey-miryanov

sergey-miryanov commented Apr 27, 2025

Copy link
Copy Markdown
Contributor

I like this proposal.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@chris-eibl

chris-eibl commented May 6, 2025

Copy link
Copy Markdown
Member Author

Closing since #131901 is merged and backported.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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

Reviewers

@pablogsal pablogsal Awaiting requested review from pablogsal pablogsal will be requested when the pull request is marked ready for review pablogsal is a code owner
@lysnikolaou lysnikolaou Awaiting requested review from lysnikolaou lysnikolaou will be requested when the pull request is marked ready for review lysnikolaou is a code owner
@ambv ambv Awaiting requested review from ambv ambv will be requested when the pull request is marked ready for review ambv is a code owner

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@chris-eibl @sergey-miryanov
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.