Basic REPL hangs when ioctls can't be written to TTY
Open
Nobody has claimed this yet.
stdlib
topic-repl
type-bug
- Dominant language
- Python
- Stars
- 77.2k
- Forks
- 35.9k
- PR merge metrics
- PR metrics pending
Description
This is related to #134466, but is regarding the basic REPL.
If you remove the ability to write ioctls to tty stdio, for example on macOS by doing
PYTHON_BASIC_REPL=1 sandbox-exec -p '(version 1) (import "system.sb") (allow process-exec) (allow file-read* (subpath "/"))' python3.13
then the REPL never shows the prompt and doesn't allow interaction, but hangs forever.
Linked PRs
- gh-139989
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running the supplied macOS sandbox command with PYTHON_BASIC_REPL=1 and observe that the basic REPL never displays a prompt. Trace the basic REPL's TTY ioctl handling and compare it with the related issue #134466; done means the REPL remains interactive when ioctl writes are unavailable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100