You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New REPL on Windows swallows characters entered via AltGr #132439
@chris-eibl Small tip (and welcome to you as a triager!): we keep the "needs backport" labels for PRs and reserve version labels to issues so to indicate which Python versions are affected (and I personally leave out version labels if every Python version is affected, unless it's a security issue).
Yeah, I was unsure about the "needs backport" for issues myself.
Regarding the "versions affected": this only applies to 3.13 and 3.14, because only those two feature the new REPL - hence we maybe should keep them in this case on the issue?
Yes, we can keep them as it's really 3.13 and 3.14 specific. In general, once a version becomes EOL or security-only, we also remove or update the labels (technically, we could even remove them as 3.12 is now security-only so those issues won't necessarily be fixed)
I can confirm this bug, tested on two different Windows 11 machines. Characters accessible via ALT GR on a German keyboard, most notably for programming Python { [ ] } , work randomly (square brackets) or not at all (curly brackets). Tested with Python 3.13.3 installed from the Microsoft Store. For Python 3.12.10 installed from the Microsoft Store, all keys / characters work just fine.
I've encountered this as well.
Bad Workaround: If you first press AltGR + 8, you can then enter exactly one AltGr grapheme.
So, AltGR + 8, AltGr + 7 produces '{' on a German keyboard. AltGR + 8, AltGr + Q produces '@' on a German keyboard.
Reacted by pewscorner, MajorTanya, Ableytner, hs-jonathan and darko664
changed the title [-]REPL on Windows swallows characters entered via AltGr[/-][+]New REPL on Windows swallows characters entered via AltGr[/+]on Apr 14, 2025
For me, the issue only occurs in an "old terminal", e.g. using cmd.exe. In a Windows terminal (e.g. powershell), the new REPL runs in virtual terminal mode
For me, the issue only occurs in an "old terminal", e.g. using cmd.exe. In a Windows terminal (e.g. powershell), the new REPL runs in virtual terminal mode
I think that's only true for the 3.14 developer preview. In the Python 3.13.3 release, there is no _supports_vt() function in windows_console.py. I have this issue no matter the terminal (the old Command Prompt and the new Windows Terminal) nor the shell (cmd.exe and PowerShell).
I went so far as to hot-patching windows_console.py locally. The REPL as of 3.13.3 is unusable for me otherwise., You don't get very far in Python without curly braces or square brackets. This is not supposed to happen in a bug-fix release.
Activity
picnixz commentedon Apr 12, 2025
@chris-eibl Small tip (and welcome to you as a triager!): we keep the "needs backport" labels for PRs and reserve version labels to issues so to indicate which Python versions are affected (and I personally leave out version labels if every Python version is affected, unless it's a security issue).
chris-eibl commentedon Apr 12, 2025
Yeah, I was unsure about the "needs backport" for issues myself.
Regarding the "versions affected": this only applies to 3.13 and 3.14, because only those two feature the new REPL - hence we maybe should keep them in this case on the issue?
picnixz commentedon Apr 12, 2025
Yes, we can keep them as it's really 3.13 and 3.14 specific. In general, once a version becomes EOL or security-only, we also remove or update the labels (technically, we could even remove them as 3.12 is now security-only so those issues won't necessarily be fixed)
noisefloor commentedon Apr 13, 2025
I can confirm this bug, tested on two different Windows 11 machines. Characters accessible via ALT GR on a German keyboard, most notably for programming Python { [ ] } , work randomly (square brackets) or not at all (curly brackets). Tested with Python 3.13.3 installed from the Microsoft Store. For Python 3.12.10 installed from the Microsoft Store, all keys / characters work just fine.
mettvterritory commentedon Apr 14, 2025
I've encountered this as well.
Bad Workaround: If you first press AltGR + 8, you can then enter exactly one AltGr grapheme.
So,
AltGR + 8, AltGr + 7 produces '{' on a German keyboard.
AltGR + 8, AltGr + Q produces '@' on a German keyboard.
[-]REPL on Windows swallows characters entered via AltGr[/-][+]New REPL on Windows swallows characters entered via AltGr[/+]chris-eibl commentedon Apr 14, 2025
For me, the issue only occurs in an "old terminal", e.g. using
cmd.exe. In a Windows terminal (e.g. powershell), the new REPL runs in virtual terminal modecpython/Lib/_pyrepl/windows_console.py
Lines 115 to 118 in 45c447b
where I can use
AltGras usual.But the "virtual terminal mode" has other problems (#131878): I can no longer enter
äÄöÖüÜ, etc., which work in the "old terminal", though.john-hen commentedon Apr 14, 2025
I think that's only true for the 3.14 developer preview. In the Python 3.13.3 release, there is no
_supports_vt()function inwindows_console.py. I have this issue no matter the terminal (the old Command Prompt and the new Windows Terminal) nor the shell (cmd.exeand PowerShell).I went so far as to hot-patching
windows_console.pylocally. The REPL as of 3.13.3 is unusable for me otherwise., You don't get very far in Python without curly braces or square brackets. This is not supposed to happen in a bug-fix release.1 remaining item
NSK-Guru commentedon Apr 20, 2025
This also occurs on danish keyboards (on win10). Can't input chars: @£${[]}|€~
Fallback to 3.13.2 worked for me.
chris-eibl commentedon Apr 20, 2025
You can also turn off the new REPL if you do not want to fallback on an earlier version:
https://docs.python.org/3/using/cmdline.html#envvar-PYTHON_BASIC_REPL
jeanga commentedon May 3, 2025
GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.e…
[3.13] pythonGH-132439: Fix REPL swallowing characters entered with A…
ambv commentedon May 5, 2025
Thanks for perservering, this is an important fix!
[3.13] GH-132439: Fix REPL swallowing characters entered with AltGr o…
pythonGH-132439: Fix REPL swallowing characters entered with AltGr on…