Bug description:
When building Python in a zsh terminal on macOS with stdin a tty (edit: and GNU readline), the build hangs indefinitely.
This is because during the build, python.exe -E check_extension_modules.py is run, which attempts to import the readline module.
At import time of the readline module
- it runs
PyInit_readline
- which calls
get_tty_settings from libreadline.dylib,
- which ultimately runs an
ioctl syscall
- which immediately suspends the Python process thanks to a SIGTTIN signal.
The Python process isn't supposed to run ioctl syscalls from the background.
I don't know where the fix should go, but I would say it's two separate issues:
- importing modules during the build sounds like a bad idea due to possible side-effects
- the readline module running an
ioctl call during import risking the process to be suspended when backgrounded sounds bad too.
CPython versions tested on:
3.14, main branch at commit 2c8f26c
Operating systems tested on:
macOS
Bug description:
When building Python in a
zshterminal onmacOSwithstdina tty (edit: and GNU readline), the build hangs indefinitely.This is because during the build,
python.exe -E check_extension_modules.pyis run, which attempts to import thereadlinemodule.At import time of the readline module
PyInit_readlineget_tty_settingsfromlibreadline.dylib,ioctlsyscallThe Python process isn't supposed to run
ioctlsyscalls from the background.I don't know where the fix should go, but I would say it's two separate issues:
ioctlcall during import risking the process to be suspended when backgrounded sounds bad too.CPython versions tested on:
3.14,
mainbranch at commit 2c8f26cOperating systems tested on:
macOS