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 — New REPL on Windows swallows characters entered via AltGr · Issue #132439 · python/cpython

New REPL on Windows swallows characters entered via AltGr #132439

New issue
Copy link
New issue
Copy link
Closed
Closed
New REPL on Windows swallows characters entered via AltGr#132439
Copy link
Labels
3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

Description

@chris-eibl
chris-eibl
opened on Apr 12, 2025
Issue body actions

Bug report

Bug description:

E.g. on my keyboard with German layout, { is usually entered via pressing the AltGr key and 7, i.e. AltGr+7.

Likewise, }, [, ], \ and some more can only be entered via AltGr.

But since #128388 / #128389 these are swallowed by the REPL on Windows and can no longer be entered.

On 3.13.3, this happens independent from the terminal mode.

On main, this only happens in legacy Windows terminals, where the virtual terminal mode is turned off (e.g. cmd.exe).

In virtual terminal mode there are other issues, see #131878.

Many other keyboard layouts like French, Czech, etc, use the AltGr key, too, and suffer the same bug (tested changing my keyboard layout).

CPython versions tested on:

3.14, 3.13

Operating systems tested on:

Windows

Linked PRs

  • GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.exe #132440
  • [3.13] GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.exe (GH-132440) #133460
Reacted by John Hennig, magnatek-mgs, Dominik Geldmacher, darko664, markusschlenker and Ander

Activity

Next
  1. chris-eibl
    added
    type-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
    3.13only security fixesonly security fixes
    3.14bugs and security fixesbugs and security fixes
    topic-replRelated to the interactive shellRelated to the interactive shell
    needs backport to 3.13only security fixesonly security fixes
    on Apr 12, 2025
  2. picnixz
    removed
    needs backport to 3.13only security fixesonly security fixes
    on Apr 12, 2025
  3. picnixz commented on Apr 12, 2025

    @picnixz
    picnixz
    on Apr 12, 2025
    Member
    More actions

    @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).

    Reacted by Chris Eibl
    Reacted by Sergey Miryanov
    Reacted by Chris Eibl
  4. picnixz
    added
    stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directory
    on Apr 12, 2025
  5. chris-eibl commented on Apr 12, 2025

    @chris-eibl
    chris-eibl
    on Apr 12, 2025
    MemberAuthor
    More actions

    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?

  6. picnixz commented on Apr 12, 2025

    @picnixz
    picnixz
    on Apr 12, 2025
    Member
    More actions

    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)

    Reacted by Chris Eibl
  7. noisefloor commented on Apr 13, 2025

    @noisefloor
    noisefloor
    on Apr 13, 2025
    More actions

    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.

  8. mettvterritory commented on Apr 14, 2025

    @mettvterritory
    mettvterritory
    on Apr 14, 2025
    More actions

    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
    Reacted by markusschlenker
  9. picnixz
    changed the title [-]REPL on Windows swallows characters entered via AltGr[/-] [+]New REPL on Windows swallows characters entered via AltGr[/+] on Apr 14, 2025
  10. chris-eibl commented on Apr 14, 2025

    @chris-eibl
    chris-eibl
    on Apr 14, 2025
    MemberAuthor
    More actions

    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

    cpython/Lib/_pyrepl/windows_console.py

    Lines 115 to 118 in 45c447b

    def _supports_vt():
    try:
    import nt
    return nt._supports_virtual_terminal()

    where I can use AltGr as usual.

    But the "virtual terminal mode" has other problems (#131878): I can no longer enter äÄöÖüÜ, etc., which work in the "old terminal", though.

  11. john-hen commented on Apr 14, 2025

    @john-hen
    john-hen
    on Apr 14, 2025
    More actions

    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.

    Reacted by magnatek-mgs
  12. 1 remaining item

  13. chris-eibl
    added
    release-blocker
    on Apr 15, 2025
  14. ezio-melotti
    added this to Release and Deferred blockers 🚫on Apr 15, 2025
  15. github-project-automation
    moved this to Todo in Release and Deferred blockers 🚫on Apr 15, 2025
  16. picnixz
    marked Keyboard layout issue with python.exe on windows 11 #132645 as a duplicate of this issue on Apr 17, 2025
  17. NSK-Guru commented on Apr 20, 2025

    @NSK-Guru
    NSK-Guru
    on Apr 20, 2025
    More actions

    This also occurs on danish keyboards (on win10). Can't input chars: @£${[]}|€~
    Fallback to 3.13.2 worked for me.

  18. chris-eibl commented on Apr 20, 2025

    @chris-eibl
    chris-eibl
    on Apr 20, 2025
    MemberAuthor
    More actions

    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

  19. picnixz
    marked Some special characters cannot be typed in python shell on Windows #132913 as a duplicate of this issue on Apr 25, 2025
  20. jeanga commented on May 3, 2025

    @jeanga
    jeanga
    on May 3, 2025 · Hidden as off-topic
    show commentMore actions
  21. ambv
    added 2 commits that reference this issue on May 5, 2025

    GH-132439: Fix REPL swallowing characters entered with AltGr on cmd.e…

    07f416a

    [3.13] pythonGH-132439: Fix REPL swallowing characters entered with A…

    3662540
  22. ambv commented on May 5, 2025

    @ambv
    ambv
    on May 5, 2025
    Contributor
    More actions

    Thanks for perservering, this is an important fix!

    Reacted by Hugo van Kemenade
    Reacted by Chris Eibl and John Hennig
    Reacted by Hugo van Kemenade
  23. ambv
    closed this as completedon May 5, 2025
  24. github-project-automation
    moved this from Todo to Done in Release and Deferred blockers 🚫on May 5, 2025
  25. ambv
    added a commit that references this issue on May 5, 2025

    [3.13] GH-132439: Fix REPL swallowing characters entered with AltGr o…

    e4d6848
  26. Pranjal095
    added a commit that references this issue on Jul 12, 2025

    pythonGH-132439: Fix REPL swallowing characters entered with AltGr on…

    bace14d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13only security fixesonly security fixes3.14bugs and security fixesbugs and security fixesrelease-blockerstdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-replRelated to the interactive shellRelated to the interactive shelltype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error

    Projects

    • Release and Deferred blockers 🚫
      Status
      Done
      Show more project fields

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    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.