GeezerVison is showing github.com — Problems with some characters: [ ] { } ... · Issue #1606 · winpython/winpython
Problems with some characters: [ ] { } ... #1606DescriptionDear all,
I am getting mad how to figure this out.
Windows 11, Winpython64-3.13.3.0dot.7z.
I run "WinPython Command Prompt.exe".
At the prompt, with my Italian keyboard, I get:
"[" with "Alt Gr" + "è"
"]" with "Alt Gr" + "+"
"{" with "Alt Gr" + "Shift" + "è"
etc
I also get these characters and others with the usual sequences "Alt"+number keyboard, such as "Alt"+1,2,5 for "}", etc
I now enter python's shell by calling "python".
None of these sequences or key combination works anymore:
"Alt Gr" + "è" gives nothing but if I repeat it I get "["
"Alt Gr" + "+" gives nothing
If I want "]" I can do "Alt Gr" + "è" followed by "Alt Gr" + "+"
If I want "{" I can do "Alt Gr" + "è" followed by "Shift" + "Alt Gr" + "è"
If I want "}" I can do "Alt Gr" + "è" followed by "Shift" + "Alt Gr" + "+"
This happens only within python.
What is also strange is that I tried another portable python for Windows, with the same absurd result.
Edit: it also happens with an installable version.
Any hint?
Thanks
Giorgio
[email protected] Activitystonebig commented on May 15, 2025 It's a python-3.13.3 issue... when launched from a dos console Reacted by Giorgio De Nunzio stonebig commented on May 15, 2025 The issue was raised on cpython, already resolved I think on 3.14.0b1.
So either you launch python repl from the powershell console, either you wait python 3.13.4 Reacted by Giorgio De Nunzio stonebig commented on May 15, 2025 Maybe it was OK on python-3.13.2 , also Reacted by Giorgio De Nunzio stonebig commented on May 15, 2025 Reacted by Giorgio De Nunzio giorgio-denunzio commented on May 16, 2025 Dear stonebig,
Thank you very much for your reply! So I had the “luck” of choosing version 3.13 😄
After reading your answer:
- I tried launching WinPython Powershell Prompt.exe and then calling Python, but the problem is still there.
- I also tried using the installed version by opening PowerShell and calling C:\Users\giorg\AppData\Local\Programs\Python\Python313\python.exe directly from the command line, but the issue persists.
Anyway, it’s not a big problem for now: I’ll simply download an older version and wait for 3.14.
Thanks again!
Best regards,
Giorgio stonebig commented on May 18, 2025 You are right, impossible to get it working... shame... so let see, just 7 lines to adjust... in your \python\Lib_pyrepl.py:
I'll do that for b2, but you may two... check lines with # GH-132439 pull 133460

def get_event(self, block: bool = True) -> Event | None:
"""Return an Event instance. Returns None if |block| is false
and there is no event pending, otherwise waits for the
completion of an event."""
if self.event_queue:
return self.event_queue.pop()
while True:
rec = self._read_input(block)
if rec is None:
return None
if rec.EventType == WINDOW_BUFFER_SIZE_EVENT:
return Event("resize", "")
if rec.EventType != KEY_EVENT or not rec.Event.KeyEvent.bKeyDown:
# Only process keys and keydown events
if block:
continue
return None
key_event = rec.Event.KeyEvent
raw_key = key = key_event.uChar.UnicodeChar
if key == "\r":
# Make enter unix-like
return Event(evt="key", data="\n") # GH-132439 pull 133460
elif key_event.wVirtualKeyCode == 8:
# Turn backspace directly into the command
key = "backspace"
elif key == "\x00":
# Handle special keys like arrow keys and translate them into the appropriate command
key = VK_MAP.get(key_event.wVirtualKeyCode)
if key:
if key_event.dwControlKeyState & CTRL_ACTIVE:
key = f"ctrl {key}"
elif key_event.dwControlKeyState & ALT_ACTIVE:
# queue the key, return the meta command
self.event_queue.insert(0, Event(evt="key", data=key)) # GH-132439 pull 133460
return Event(evt="key", data="\033") # keymap.py uses this for meta
return Event(evt="key", data=key) # GH-132439 pull 133460
if block:
continue
return None
if key_event.dwControlKeyState & ALT_ACTIVE:
# queue the key, return the meta command
if not key_event.dwControlKeyState & CTRL_ACTIVE: # GH-132439 pull 133460
self.event_queue.insert(0, Event(evt="key", data=key)) # GH-132439 pull 133460
return Event(evt="key", data="\033") # GH-132439 pull 133460
return Event(evt="key", data=key) # GH-132439 pull 133460
def push_char(self, char: int | bytes) -> None:````
Reacted by Giorgio De Nunzio stonebig commented on May 18, 2025 Reacted by Giorgio De Nunzio giorgio-denunzio commented on May 18, 2025 Congratulations :-)
Thanks for sharing!
Best,
Giorgio stonebig commented on May 18, 2025 NOT FULLY resolved in b2, binaries at:
Reacted by Giorgio De Nunzio stonebig commented on May 21, 2025 well a=[ 1, 2] works, but not copy/paste of code stonebig commented on May 21, 2025 So the "hammer" way WAS, is, to just copy from cpython-3.13 branch the inside lib\_pyrepl object that have changes since less than 2 month.
Trying to be smart was stupid
you can download at the same _pyrepl place all the 7 filesmodified since less than 2 month from https://github.com/python/cpython/tree/3.13/Lib/_pyrepl

It works, did check on the copy/past of sudoku code in the console proofing giorgio-denunzio commented on May 21, 2025 Wow! When I opened the issue, I didn’t think I’d end up keeping you up at night! :-D
Congratulations!
Giorgio stonebig commented on May 21, 2025 nevertheless, copy.paste is wayyyy faster in 3.14 console... so it fixes but it's slow:
- 8 seconds to paste 250 lines on 3.13 patched REPL
- 0.5 second or less on 3.14 REPL
Reacted by Giorgio De Nunzio stonebig commented on May 21, 2025 this is were you see there is way more WORKFORCE than before in cpython Reacted by Giorgio De Nunzio stonebig commented on May 21, 2025 in 3.13.1 , the copy paste WAS also that slow... and NOT WORKING.
so:
- my patch was maybe correct
- but 3.13.1 to 3.13.3 was not "copy/paste" friendly
- it's really python-3.14.0 improvements
... feeling less stupid, but it was still not smart Reacted by Giorgio De Nunzio stonebig commented on May 24, 2025 also, current REPL in 3.14 b1:
- on par with ptpython for copy/paste
- still feels less stable and complete than ptpyhon.... but they stiil backport things, so issues raising may help after b2
stonebig commented on May 26, 2025 the slowness of REPL on copy/past was raised in february... python/cpython#130328
a fix reached 3.14 yesterday python/cpython#134653
not sure the fix will reach 3.13 ... in theory it's more a bug than a feature. stonebig commented on May 26, 2025 as I was already faster when I took the 3.14, I suppose it comes from this that already speed-up things python/cpython#133247 stonebig commented on May 26, 2025 no backport for the slowness problem .... so 3.13 will remain with ptpython when available.
for 3.14, we need to see what 3.14b2 brings in completion.
ptpython (and jedi) was a giant leap forward, I hope more of it will integrate the standard over time
wppm -p ptpython
ptpython==3.0.29 ,
appdirs==1.4.4
jedi==0.19.2 >=0.16.0,
parso==0.8.4 (<0.9.0,>=0.8.4)
prompt-toolkit==3.0.50 <3.1.0,>=3.0.43,
wcwidth==0.2.13
pygments==2.19.1
MetadataMetadataDevelopmentNo branches or pull requestsIssue actions
|