Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Python 3.13+ REPL inserts ~ on [Del] [PgUp] [PgDn] with TERM=vt100 #124027

Closed
Labels
topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error
@hroncok

Description

@hroncok

Bug report

Bug description:

I've noticed that the Python 3.13+ REPL misbehaves in amock shell environment. Whenever I pressDel,PgUp, orPgDn, a literal~ character is inserted.

tl;dr this happens when you runTERM=vt100 python3.13.

Details:

I did not know what was special about the mock shell, but this did not happen with the old readline-based REPL.

When trying to figure out what's different in the mock shell I looked atenv and it was:

SHELL=/bin/bashHISTCONTROL=ignoredupsHISTSIZE=1000HOSTNAME=2f26bd11c076PWD=/builddirLOGNAME=rootHOME=/builddirLANG=C.UTF-8LS_COLORS=...snip...PROMPT_COMMAND=printf "\033]0;<mock-chroot>\007"TERM=vt100USER=rootSHLVL=1PS1=<mock-chroot> \s-\v\$ DEBUGINFOD_URLS=https://debuginfod.fedoraproject.org/ PATH=/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbinMAIL=/var/spool/mail/root_=/usr/bin/env

I found out that to reproduce, all I have to do is to setTERM=vt100. I don't know the actual meaning of that, but it changes the behavior of the new REPL, but not the old.

$ TERM=vt100 python3.13Python 3.13.0rc2 (main, Sep  7 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>

Pressing either ofDel,PgUp, orPgDn (possibly other keys?) adds a literal~ instead of doing any of the expected actions (history traverse up, down, deleting the next character if any).

$ TERM=vt100 python3.12Python 3.12.6 (main, Sep  9 2024, 00:00:00) [GCC 13.3.1 20240522 (Red Hat 13.3.1-1)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>

Pressing either ofDel,PgUp, orPgDn does what it is supposed to do.


To reproduce my actual use case, first install mock. The easiest way is to use podman (or docker) with Fedora. Followinghttps://rpm-software-management.github.io/mock/#mock-inside-podman-fedora-toolbox-or-docker-container

$ podman run --rm --privileged -ti fedora:40 bash  # or docker run --cap-add=SYS_ADMIN ...# dnf install -y mock# useradd mockbuilder# usermod -a -G mock mockbuilder# su - mockbuilder$ mock -r fedora-rawhide-x86_64 --no-bootstrap-image install python3.13 python3.12...$ mock -r fedora-rawhide-x86_64 shell...<mock-chroot> sh-5.2# python3.13Python 3.13.0rc2 (main, Sep  7 2024, 00:00:00) [GCC 14.2.1 20240905 (Red Hat 14.2.1-2)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>

CPython versions tested on:

3.13

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic-replRelated to the interactive shelltype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp