Skip to content

gh-154225: Fix os.openpty() acquiring a controlling terminal on Solaris#154229

Merged
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:openpty-ctty-illumos
Jul 20, 2026
Merged

gh-154225: Fix os.openpty() acquiring a controlling terminal on Solaris#154229
serhiy-storchaka merged 2 commits into
python:mainfrom
serhiy-storchaka:openpty-ctty-illumos

Conversation

@serhiy-storchaka

@serhiy-storchaka serhiy-storchaka commented Jul 20, 2026

Copy link
Copy Markdown
Member

On illumos/Solaris the ptem STREAMS module pushed by os.openpty() makes the slave a terminal, which a session leader without a controlling terminal then acquires despite O_NOCTTY. This hangs the pty-based test cluster under python -m test -jN (regrtest workers are session leaders). Disown a newly-acquired controlling terminal with TIOCNOTTY. Verified on illumos: the cluster passes in workers, normal openpty() still returns a working tty, and a pre-existing controlling terminal is left untouched.

🤖 Generated with Claude Code

… Solaris

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@serhiy-storchaka
serhiy-storchaka enabled auto-merge (squash) July 20, 2026 08:22
@serhiy-storchaka
serhiy-storchaka merged commit a0caab9 into python:main Jul 20, 2026
54 checks passed
@miss-islington-app

Copy link
Copy Markdown

Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14, 3.15.
🐍🍒⛏🤖

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.14 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a0caab9db6c2655d8429279892848d817343f99d 3.14

@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

GH-154238 is a backport of this pull request to the 3.15 branch.

@miss-islington-app

Copy link
Copy Markdown

Sorry, @serhiy-storchaka, I could not cleanly backport this to 3.13 due to a conflict.
Please backport using cherry_picker on command line.

cherry_picker a0caab9db6c2655d8429279892848d817343f99d 3.13

@bedevere-app bedevere-app Bot removed the needs backport to 3.15 pre-release feature fixes, bugs and security fixes label Jul 20, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…n Solaris (GH-154229) (GH-154238)

(cherry picked from commit a0caab9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

GH-154256 is a backport of this pull request to the 3.14 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.14 bugs and security fixes label Jul 20, 2026
@bedevere-app

bedevere-app Bot commented Jul 20, 2026

Copy link
Copy Markdown

GH-154257 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app Bot removed the needs backport to 3.13 bugs and security fixes label Jul 20, 2026
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…n Solaris (GH-154229) (GH-154256)

(cherry picked from commit a0caab9)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
serhiy-storchaka added a commit that referenced this pull request Jul 20, 2026
…n Solaris (GH-154229) (GH-154257)

(cherry picked from commit a0caab9)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant