Skip to content

Forkpty replace#21

Open
RoniKishner wants to merge 1 commit into
mainfrom
forkpty-replace
Open

Forkpty replace#21
RoniKishner wants to merge 1 commit into
mainfrom
forkpty-replace

Conversation

@RoniKishner

Copy link
Copy Markdown
Owner
What this PR does / why we need it:

replace pexpect.spawn with pty+subprocess to avoid forkpty

  • Replace pexpect.spawn with pty.openpty() + subprocess.Popen to avoid deprecated os.forkpty() in Python 3.12+ multi-threaded processes
  • Add _spawn_console() to create a pty pair and wrap the subprocess in pexpect.fdpexpect.fdspawn
  • Add _terminate_proc() to cleanly shut down the subprocess, call it in both the connect error path and disconnect cleanup
  • Simplify console_eof_sampler() — remove parameters, use _spawn_console() internally
Which issue(s) this PR fixes:

DeprecationWarning on test_vm_console

Special notes for reviewer:

The following warning was shown:
/tmp/pr-tests/.local/share/uv/python/cpython-3.14.5-linux-x86_64-gnu/lib/python3.14/pty.py:66: DeprecationWarning: This process (pid=110) is multi-threaded, use of forkpty() may lead to deadlocks in the child.

jira-ticket:

NONE

@RoniKishner

Copy link
Copy Markdown
Owner Author

/split-pr

@pull-apart

pull-apart Bot commented Jun 21, 2026

Copy link
Copy Markdown

Split complete. Open these pull requests:

@pull-apart

pull-apart Bot commented Jun 22, 2026

Copy link
Copy Markdown

/split-pr

1 similar comment
@automation-flow-helper

Copy link
Copy Markdown

/split-pr

@pull-apart

pull-apart Bot commented Jun 22, 2026

Copy link
Copy Markdown

Split complete. Open these pull requests:

@RoniKishner

Copy link
Copy Markdown
Owner Author

/split-pr

@pull-apart

pull-apart Bot commented Jun 27, 2026

Copy link
Copy Markdown

To open the split PRs under your GitHub account (so you can edit and close them), please authorize the app.

Once authorized, the split will run automatically. The link expires in 1 hour; comment /split-pr again if it does.

@RoniKishner

Copy link
Copy Markdown
Owner Author

/split-pr

@pull-apart

pull-apart Bot commented Jun 27, 2026

Copy link
Copy Markdown

You need to wait 5 minutes before calling /split-pr again on this pull request (about 3 minutes remaining).

@pull-apart

pull-apart Bot commented Jun 27, 2026

Copy link
Copy Markdown

Split complete. Open these pull requests:

@RoniKishner RoniKishner force-pushed the forkpty-replace branch 2 times, most recently from a5dde78 to a0ccc75 Compare June 30, 2026 06:33
Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: rkishner <rkishner@redhat.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.

2 participants